CustomFloat

Benji Smith dlanguage at benjismith.net
Fri Oct 17 17:26:45 PDT 2008


Andrei Alexandrescu wrote:
> I found myself in need for smaller and specialized floating point types, 
> where I configure the exact configuration (sign, mantissa, exponent, 
> bias). See http://en.wikipedia.org/wiki/Half_precision for a half 
> precision number slated for inclusion in IEEE 754r.

I would definitely find that useful. Not so much for runtime calculation 
(though I wouldn't object to it) but for serialization.

A few years ago, I implement a half-precision float for Java because I 
needed to send a bazillion measurements across a slow connection. The 
nature of the data was such that I didn't mind losing precision, as long 
as I could send twice as many values.

Having that functionality in D, without having to write it myself, would 
be very handy.

--benji



More information about the Digitalmars-d mailing list