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?
cheers
On 28/01/15 16:20, Alexandre Torres Porres wrote:
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?
welcome to floating point :)
https://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conver... https://en.wikipedia.org/wiki/Machine_epsilon
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@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
it's a limitation of 32 bit float
I thought so, but same happens when I use the new Pd Vanilla 64 bits...
what now? :)
2015-01-28 14:41 GMT-02:00 Cyrille Henry ch@chnry.net:
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@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Le 28/01/2015 17:47, Alexandre Torres Porres a écrit :
it's a limitation of 32 bit float
I thought so, but same happens when I use the new Pd Vanilla 64 bits...
this mean that it's compiled for 64 bit CPU, not that float are store on 64 bits
you can have 8 bit int, 32 bit float and 64 bit float (and more) on a 32 bit CPU. and also on a 64 bit CPU. even 8 bit cpu can deal with 32/64 bit float...
cheers c
what now? :)
2015-01-28 14:41 GMT-02:00 Cyrille Henry <ch@chnry.net mailto:ch@chnry.net>:
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@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/__listinfo/pd-list <http://lists.puredata.info/listinfo/pd-list> _________________________________________________ Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/__listinfo/pd-list <http://lists.puredata.info/listinfo/pd-list>
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Wed, Jan 28, 2015 at 12:00 PM, Cyrille Henry ch@chnry.net wrote:
Le 28/01/2015 17:47, Alexandre Torres Porres a écrit :
it's a limitation of 32 bit float
I thought so, but same happens when I use the new Pd Vanilla 64 bits...
this mean that it's compiled for 64 bit CPU, not that float are store on 64 bits
Also last time I checked, Pd saves floats by first printing them to 6 digit precision, so they have even less range than a 'float' type. You could use an object made with pdlua to manipulate large floating-point numbers, as there is no(?) limit to the size of a float in lua.
Martin