What is the minimum precision allowed for floats.
Vincent Diepeveen
diep at xs4all.nl
Mon Sep 29 13:59:10 CEST 2008
Nah not factor 100.
After most mathematical calculation you just AND with 0xffffffff
to get 48 bits precision.
Maybe worst case factor 2?
Rest with your message i fully agree with of course.
Suppose the guy has some hardware that has this precision and wants
to simulate it :)
On Sep 29, 2008, at 5:05 AM, Décio Luiz Gazzoni Filho wrote:
>
> On Sep 28, 2008, at 5:47 PM, Joel Kronander wrote:
>
>> Hi
>>
>> I have a question regading the possible minimun precision for floats.
>> For example is it possible to use a precision between native c float
>> and double
>> ie precision digits between 6-15 for exmample.
>
> I suppose you could do it, but why? First of all, you'd be moving from
> hardware-accelerated to software-emulated, so I would expect slowdowns
> on the order of 10x-100x. If you're doing it hoping to get a speedup,
> just trash the idea, it'll never ever work. If you want to save memory
> by, say, having a 48-bit float, and you don't care about the slowdown
> due to software emulation... well, first of all, GMP probably works
> with multiples of 32 or 64 bits, so 48 bits is out of the question,
> and besides, I believe it uses a whole limb (i.e. 32 or 64 bits) for
> the exponent and whatever is needed for the mantissa, so there'd be a
> further waste of memory if that's what you're concerned with. Maybe if
> you roll your own package.
>
> I have no idea what you're working with, but have you considered fixed
> point rather than floating point? The speed hit shouldn't be too
> substantial, and you get the full word for the mantissa (in exchange
> for limited dynamic range).
>
> Décio
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at swox.com
> https://gmplib.org/mailman/listinfo/gmp-discuss
>
>
More information about the gmp-discuss
mailing list