should double have better precision or greater range?

Michael J. Steiner U23405 at UICVM
Mon Aug 29 01:46:25 AEST 1988


I may go as far as to say that there should be two kinds of doubles, one
with better precision and another with greater range. They could be called
something like "acdouble" and "widouble" standing for "accurate double"
and "wide double" respectively. I can't really choose between the two
because whether a programmer would want to use an accurate double or a wide
double would depend on what kind of application he is doing.

Also, I recently heard of a "long double". Since double is defined as
"long float", this would mean "long long float", which is confusing.
As far as I know, C doesn't allow this. (It would be nice, though, to make
a data type as long as you want by saying "long long long long ... <type>")
Anyone hear about this?

One last thing: Would an expression be evaluated more quickly if the RHS
had variables of type short or type int? For example, which would be faster:

          int a, b, c;
          a = b * c - (int) 4;

          int a; short b, c;
          a = b * c - (short) 4;

                                                 Michael Steiner
P.S. Thanks for the help with                    Email: U23405 at UICVM.BITNET
sorting algorithms and "IF
STATEMENT EFFICIENCY".



More information about the Comp.lang.c mailing list