bigfloat

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Apr 8 14:07:42 PDT 2009


grauzone wrote:
> Andrei Alexandrescu wrote:
>> Paul D. Anderson wrote:
>>> Walter Bright Wrote:
>>>
>>>> Paul D. Anderson wrote:
>>>>> b) the features and functions that should be included.
>>>> I'd say NaNs and unordered comparisons. In other words, it should 
>>>> support the same semantics as float, double and real do.
>>>>
>>>> If you've got the time and interest, adding all the functions in 
>>>> std.math would be great!
>>>
>>> I'm not sure I can sign up for ALL of std.math. I'm sure I'll need
>>> help.  I can do roots, powers and transcendental functions, though.
>>> Maybe not very efficiently (power series).
>>>
>>> (If very high precision numbers are questionable, how valuable are
>>> high precision sine and cosine??)
>>>
>>> Paul
>>
>> Would be great if we could enlist Don's help. Don? :o)
>>
>> In only slightly related news, the "new, new" Phobos2 offers custom 
>> floating-point numbers, see
>>
>> http://erdani.dreamhosters.com/d/web/phobos/std_numeric.html
>>
>> They aren't infinite precision (which makes their utility orthogonal 
>> on bigfloat's), but they allow fine tweaking of floating point 
>> storage. Want to cram floats in 16 or 24 bits? Care about numbers in 
>> [0, 1) at maximum precision? Give CustomFloat a shot.
> 
> 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.

Andrei



More information about the Digitalmars-d mailing list