CustomFloat

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 17 06:57:37 PDT 2008


Don wrote:
>>>> In theory it would be great to have this in Phobos.  I say in theory
>>>> because I haven't actually been in need of such a thing recently, but
>>>> it is definitely handy to have if you're working with high dynamic
>>>> range images (like from openEXR), or doing other GPU-related things.
>>>> Is that the kind of thing you need them for too?  I've heard of using
>>>> anything beyond 16-bit and 24-bit floats in the GPU/HDR world, though.
>>>>  A full generic solution is probably overkill for that.
>>> Yah, graphics is a big target for such types (and a big pusher for
>>> standardizing them). I need such numbers for different purposes, i.e.
>>> storing large arrays of probability distribution. In that case the 
>>> range is
>>> [0, 1] and I need to cram those numbers in as little space as 
>>> possible. I
>>> could definitely use a customized floating point layout.
> 
> Wouldn't it be better to use fixed point for that application? Or are 
> the numbers distributed uniformly in IEEE space (ie, as many between 
> 0.0025 and 0.005, as between 0.5 and 0.1)?

The latter. Relative precision has to be about constant within the whole 
range. In fact I could store logprobs in fixed-point format, but that 
makes addition slow.


Andrei



More information about the Digitalmars-d mailing list