[PD] weird float/add limitation

Cyrille Henry ch at chnry.net
Wed Jan 28 17:41:40 CET 2015



Le 28/01/2015 17:20, Alexandre Torres Porres a écrit :
> howdy, check the attached patch.
>
> 1e+06 + 1 is not equal to 1e+06
>
> but 1e+09 + 1 is equal to 1e+09
>
> meaning it didn't add 1 to 1e+09! Meaning there's a limit where it stops adding 1 to something.
>
> how's that and why?

it's a limitation of 32 bit float.
since 1 bit is used for the sign, 8 for the exponent, 23 bit are left for the significant.
this mean that you can't have more precision in the significant than 2^24 -1 (a bit less than 1.7*10^7)

cheers
c

>
> cheers
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>



More information about the Pd-list mailing list