bigfloat

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Apr 8 14:45:18 PDT 2009


Andrei Alexandrescu wrote:
> grauzone wrote:
>> Sorry for the uninformed question, but do these types with with std.math?
> 
> If you meant to ask whether they work with std.math, yes, but only in 
> the sense that they are convertible from and to the built-in floating 
> point types. I've been coquetting with the idea of implementing some 
> operations natively, but there's so much hardware dedicated to IEEE 
> formats, it's faster to convert -> use -> convert back, than to emulate 
> in software.

That won't give correct results if you want *more* precision than native types 
allow.
For example, imagine a cross-compiler from $PLATFORM to X86 implemented in D; it 
would want to do constant-folding on 80-bit floats but $PLATFORM likely doesn't 
support anything but float & double.

I could imagine a similar reason for wanting appropriate rounding behavior, even 
for smaller types not natively supported.



More information about the Digitalmars-d mailing list