[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: mixed decimal floating and binary floating arithmetic
On 2009-04-16 13:54:57 +0900, Malcolm Cohen wrote:
Dan Zuras IEEE wrote:
That is, mixed radix
operations should be disallowed.
...
It was our intent that Fortran disallow it as well.
Fortran has always allowed this. It seems unlikely that we will choose
to be deliberately incompatible with previous standards; not impossible,
but unlikely.
So, if you have an operation between a binary64 and a decimal64, which
format would you choose for the result? And why?
Ditto with binaryM and decimalN for any M and N.
Since mixed-mode operations between 32-bit integer and single precision,
or 64-bit integer and double precision, have the "undesirable"
characteristic of the conversion not being to a superset, and those
don't seem to be disapproved of, I find it hard to get exercised over
the possibility of the user mixing binary and decimal.
However, for an operation between an integer and a floating type, most
people would agree that choosing the floating type for the result would
be less a problem than choosing an integer, particular because one often
uses small integers (that can be represented in the floating type).
IMHO the main problem concerning binary/decimal mixed operations is
that there is no canonical choice for the format of the result.
For that matter, operations involving single-precision complex and
double precision real are similarly "bad". In fact enormously worse
than mixing similar precisions of binary and decimal!
I don't know FORTRAN, but a language should be designed to perform
the operation in double-precision complex.
BTW, mixing signed and unsigned integer types in C is even worse since
this can give a result that can be different from what one would obtain
on the set of integers (assuming the result is representable is the
target type).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)