Difference between revisions of "NextFloatToward"
(Created page with "''New to Analytica 6.3'' == NextFloatToward( x, to ) == When <code>to > x</code>, returns the smallest 64-bit floating point number that is larger than «x». When <cod...") |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[category:Data Type Functions]] | ||
+ | [[category:Math Functions]] | ||
''New to [[Analytica 6.3]]'' | ''New to [[Analytica 6.3]]'' | ||
== NextFloatToward( x, to ) == | == NextFloatToward( x, to ) == | ||
+ | |||
+ | Increases or decreases «x» the minimal amount possible (to the next representable number) in the direction of «to». | ||
When <code>to > x</code>, returns the smallest 64-bit floating point number that is larger than «x». | When <code>to > x</code>, returns the smallest 64-bit floating point number that is larger than «x». | ||
Line 16: | Line 20: | ||
== See also == | == See also == | ||
− | * MantissaAndExponent | + | * [[MantissaAndExponent]] |
Latest revision as of 02:25, 29 January 2023
New to Analytica 6.3
NextFloatToward( x, to )
Increases or decreases «x» the minimal amount possible (to the next representable number) in the direction of «to».
When to > x
, returns the smallest 64-bit floating point number that is larger than «x».
When to < x
, returns the largest 64-bit floating point number that is smaller than «x».
When to = x
, returns x.
This function can be useful when you are working around numeric round-off issues.
Examples
NextFloatToward( 10.0, INF ) → 10.000000000000002
NextFloatToward( 10.0, -INF ) → 9.999999999999998
See also
Comments
Enable comment auto-refresher