add phobos module std.halffloat ?

Robert Jacques rjacque2 at live.johnshopkins.edu
Wed Dec 19 12:44:20 PST 2012


On Wed, 19 Dec 2012 04:49:59 -0600, d coder <dlang.coder at gmail.com> wrote:

> On Wed, Dec 19, 2012 at 3:43 PM, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
>
>> How difficult would you think it would be to scale down (or up) this
>> library type so it can be an emulated IEEE type of any size? (The whole
>> shebang eg: quarter, half, single, double, quad, double-quad, 80bit and
>> 96-bit).   Just interested as I think that a module which implements an
>> IEEE floating point type that produces constant results cross-platform
>> would be better than a dedicated module just for half float types.
>>
>
>
> +1

See std.numeric.CustomFloat. It supports quarter, half, single, double and  
80-bit. The wikipedia article on the  floating point (IEEE 754) includes a  
Quad type but not a double-quad or 96-bit type. 96-bit Should be possible,  
as it's just 80-bits with padding. Quad and double quad would be tougher  
to do, do to the lack of a quad integer type or a 112-bit bit shift  
operator.


More information about the Digitalmars-d mailing list