Page 1 of 1

Discussion about floats and doubles

Posted: Wed Sep 18, 2013 2:26 pm
by Little John
removed

(I did neither start nor intend this discussion.)

Re: Extended precision floating-point calculations

Posted: Wed Sep 18, 2013 2:33 pm
by KJ67
+1, using the native functions and especially on things like log() and sqr() accumulates to rather big deviations since they even on the 64 bit PB only uses floats.

Re: Extended precision floating-point calculations

Posted: Wed Sep 18, 2013 2:38 pm
by freak
KJ67 wrote:+1, using the native functions and especially on things like log() and sqr() accumulates to rather big deviations since they even on the 64 bit PB only uses floats.
That statement is wrong. These functions use doubles when you store the results in double variables. Doubles are available since v4.00

Re: Extended precision floating-point calculations

Posted: Wed Sep 18, 2013 2:51 pm
by KJ67
freak wrote:
KJ67 wrote:+1, using the native functions and especially on things like log() and sqr() accumulates to rather big deviations since they even on the 64 bit PB only uses floats.
That statement is wrong. These functions use doubles when you store the results in double variables. Doubles are available since v4.00
That is very good news and will simplify things, but the documentation header states "Result.f = Sqr(Number.f)", the much wider interpretation of "This function can handle float and double values" was something I missed.

Re: Extended precision floating-point calculations

Posted: Wed Sep 18, 2013 3:21 pm
by freak
Its on the overview page of the Math library:
Almost all these functions work with floats or doubles, i.e. numbers with the .f or .d extensions. If a function is used with a double value as input or output, it will automatically switch to double precision instead of single precision for its calculations.

Re: Discussion about floats and doubles

Posted: Wed Sep 18, 2013 4:32 pm
by freak
Locked due to repeated abuse of the topic editing functionality by the OP. If you can't be civilized about it then don't post at all!