On Jun 11, 11:48 am, Frank Millman [EMAIL PROTECTED] wrote:
Thanks to all for the various replies. They have all helped me to
refine my ideas on the subject. These are my latest thoughts.
[snip]
My main concern is that my approach may be naive, and that I will run
into situations that I have
On 2008-06-12, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
If you were to follow the footsteps of COBOL, you'd be using
BCD internally, with a special code to represent the decimal
point (and maybe, to save space, the sign too)
Old mainframes had instructions to work with packed BCD as a
Thanks to all for the various replies. They have all helped me to
refine my ideas on the subject. These are my latest thoughts.
Firstly, the Decimal type exists, it clearly works well, it is written
by people much cleverer than me, so I would need a good reason not to
use it. Speed could be a
Frank Millman wrote:
Thanks to all for the various replies. They have all helped me to
refine my ideas on the subject. These are my latest thoughts.
Firstly, the Decimal type exists, it clearly works well, it is written
by people much cleverer than me, so I would need a good reason not to
use
On Jun 11, 4:39 pm, Ethan Furman [EMAIL PROTECTED] wrote:
Frank Millman wrote:
Thanks to all for the various replies. They have all helped me to
refine my ideas on the subject. These are my latest thoughts.
Out of curiosity, what is the purpose of these numbers? Do they
represent money,
Frank Millman [EMAIL PROTECTED] wrote:
Thanks to all for the various replies. They have all helped me to
refine my ideas on the subject. These are my latest thoughts.
Firstly, the Decimal type exists, it clearly works well, it is written
by people much cleverer than me, so I would need a
Frank Millman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Thanks to all for the various replies. They have all helped me to
| refine my ideas on the subject. These are my latest thoughts.
|
| Firstly, the Decimal type exists, it clearly works well, it is written
| by people much
In article [EMAIL PROTECTED],
Frank Millman [EMAIL PROTECTED] wrote:
My approach is based on expressing a decimal number as a combination
of an integer and a scale, where scale means the number of digits to
the right of the decimal point.
You should probably use one written by an expert:
Mel wrote:
Frank Millman wrote:
Hi all
I have a standard requirement for a 'decimal' type, to instantiate and
manipulate numeric data that is stored in a database. I came up with a
solution long before the introduction of the Decimal type, which has
been working well for me. I know the
Hi all
I have a standard requirement for a 'decimal' type, to instantiate and
manipulate numeric data that is stored in a database. I came up with a
solution long before the introduction of the Decimal type, which has
been working well for me. I know the 'scale' (number of decimal
places) of the
On Jun 9, 5:11 pm, Frank Millman [EMAIL PROTECTED] wrote:
I have a standard requirement for a 'decimal' type, to instantiate and
manipulate numeric data that is stored in a database. I came up with a
solution long before the introduction of the Decimal type, which has
been working well for me.
On Jun 9, 10:54 am, Paul Hankin [EMAIL PROTECTED] wrote:
Hi Frank,
I don't know why you think Decimal is complicated: it has some
advanced features, but for what you seem to be doing it should be easy
to replace your 'Number' with it. In fact, it makes things simpler
since you don't have to
Frank Millman wrote:
Hi all
I have a standard requirement for a 'decimal' type, to instantiate and
manipulate numeric data that is stored in a database. I came up with a
solution long before the introduction of the Decimal type, which has
been working well for me. I know the 'scale'
On Jun 9, 3:07 pm, Mel [EMAIL PROTECTED] wrote:
Frank Millman wrote:
class Number(object):
def __init__(self,value,scale):
self.factor = 10.0**scale
if isinstance(value,Number):
value = value.value / value.factor
I think this could lead to trouble.
On Jun 9, 4:06 pm, Frank Millman [EMAIL PROTECTED] wrote:
Thanks for the reply, Mel. I don't quite understand what you mean.
As so often happens, after I sent my reply I re-read your post and I
think I understand what you are getting at.
One problem with my approach is that I am truncating the
Frank Millman wrote:
On Jun 9, 4:06 pm, Frank Millman [EMAIL PROTECTED] wrote:
Thanks for the reply, Mel. I don't quite understand what you mean.
As so often happens, after I sent my reply I re-read your post and I
think I understand what you are getting at.
One problem with my approach
16 matches
Mail list logo