Re: Gentler Decimal Floating-Point
- From: "Mike Cowlishaw" <mfc@xxxxxxxxxx>
- Date: Sat, 31 Mar 2007 20:29:49 +0100
|> Maybe it was very clear then (it certainly wasn't to me at the time).
|> Today, fixed types (except perhaps integers) are an embarrassment, in
binary
|> or decimal.
It was clear then, and is clear now, that the requirements for financial
need either fixed-point decimal (with a precisely controllable precision)
or something that emulates it. I have never heard of any requirement for
decimal FLOATING-POINT arithmetic and, despite frequent requests, you
have never demonstrated one. If you want to use a financial argument,
please provide a reference to some law or similar that specifies the
use of decimal floating-point.
Apart from ISO COBOL 2002, you might follow some of the links from my
website. You willl find at least one financial reference that requires that
conversion rates be specified to a certain number of (significant) digits,
typically six. It would be possible, though not impossible, to express
exchange rates as fixed decimal -- but no one does that, except locally.
In 'your' general decimal, you emulate fixed point in an ingenious way,
which adds a lot of complication. Fine. I may disagree, but that is a
matter of opinion. There is no doubt that you can do the job, PROVIDED
that the representation is large enough that overflow never becomes an
issue AND THAT the code is modified to force the number of digits on
multiplication and division.
It is not 'my' specification. All I have done is try to write down what
people actually do, and have done for hundreds of years. Why is that
'wrong'?
|> > To be blunt, nobody wanted it.
|>
|> Hmm -- why would there have been the debate about how to implement it
if no
|> one wanted it? ...
I was talking about the specification. No numeric programmer gave a
damn about the base, except for those that insisted on binary. The
financial programmers wanted fixed-point with overflow detection,
as in COBOL.
Remember that my contacts were the financial programming experts and
the numerical experts. NONE of them wanted decimal floating-point.
To how many of them did you offer the option: "how about my computer program
gives you the same result as you get when you do the calculation on paper"?
That's what they ask for -- and that is decimal and floating point. That's
why languages such as C#, Rexx, and Java only offer floating-point decimal.
|> But more to the point, languages since then have all
|> migrated towards floating-point for decimals. ...
Eh? 'Decimals'? What they? Seriously. There is no such thing as
'decimals' without associating it with a fixed- or floating-point
qualifier.
[1.20 is a decimal number. No qualifier required :-)]
|> Take a look at the the
|> decimal support in Java, VB, C#, Eiffel, Python, Rexx, Perl6, Ruby.
They
|> are all floating-point.
I am tempted to be rude at this point. At least Python (and I think
several of the others) are following 'your' specification, because they
had been persuaded by 'you' that it is the future. To use that as
evidence that they wanted decimal floating-point in the first place is
at best dubious.
That's bizarre. To suggest that I have 'persuaded' Python's designers -- or
any others -- is absurd; they are more than capable of making their own
decisions, and to suggest otherwise is insultng to them.
mfc
.
- References:
- Gentler Decimal Floating-Point
- From: Quadibloc
- Re: Gentler Decimal Floating-Point
- From: glen herrmannsfeldt
- Re: Gentler Decimal Floating-Point
- From: Nick Maclaren
- Re: Gentler Decimal Floating-Point
- From: Mike Cowlishaw
- Re: Gentler Decimal Floating-Point
- From: Quadibloc
- Re: Gentler Decimal Floating-Point
- From: Mike Cowlishaw
- Re: Gentler Decimal Floating-Point
- From: Quadibloc
- Re: Gentler Decimal Floating-Point
- From: Nick Maclaren
- Re: Gentler Decimal Floating-Point
- From: Quadibloc
- Re: Gentler Decimal Floating-Point
- From: glen herrmannsfeldt
- Re: Gentler Decimal Floating-Point
- From: Nick Maclaren
- Re: Gentler Decimal Floating-Point
- From: Mike Cowlishaw
- Re: Gentler Decimal Floating-Point
- From: Nick Maclaren
- Gentler Decimal Floating-Point
- Prev by Date: Re: Gentler Decimal Floating-Point
- Previous by thread: Re: Gentler Decimal Floating-Point
- Next by thread: Re: Gentler Decimal Floating-Point
- Index(es):
Relevant Pages
|