Discussion about floats and doubles
Posted: Wed Sep 18, 2013 2:26 pm
removed
(I did neither start nor intend this discussion.)
(I did neither start nor intend this discussion.)
http://www.purebasic.com
https://www.purebasic.fr/english/
That statement is wrong. These functions use doubles when you store the results in double variables. Doubles are available since v4.00KJ67 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 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.freak wrote:That statement is wrong. These functions use doubles when you store the results in double variables. Doubles are available since v4.00KJ67 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.
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.