Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7596

SDK • Re: Floating point bugs on RP2040 and RP235X ?

$
0
0
pico_set_float_implementation(<TARGET> compiler)
pico_set_double_implementation(<TARGET> compiler)
Thanks. For both RP2040 and RP235X that's resolved the consistency issues between 32-bit and 64-bit there -

Code:

00000000 is 0.0000000000FFFF is 0.00000080000000 is 0.0000008000FFFF is -0.0000007F800000 is inf7F80FFFF is nanFF800000 is -infFF80FFFF is nan

Code:

0000000000000000 is 0.000000000000000000FFFF is 0.0000008000000000000000 is 0.000000800000000000FFFF is -0.0000007FF0000000000000 is inf7FF000000000FFFF is nanFFF0000000000000 is -infFFF000000000FFFF is nan
I am also accepting the following is correct, likewise for 64-bit equivalents -

Code:

80000000 is 0.000000<-- Minus zero is zero8000FFFF is -0.000000<-- Negative denormalised is a small negative rounded to zero number 
great, so using say %.9g instead will show the subnormal value?

Statistics: Posted by breaker — Wed Jul 30, 2025 5:46 pm



Viewing all articles
Browse latest Browse all 7596

Trending Articles