Description Usage Arguments Details Author(s) Examples
These functions get and set the rounding mode for the floating point operations.
1 2 3 4 5 6 7 | fegetround()
fesetround(rounding.mode = FE.TONEAREST)
FE.DOWNWARD
FE.UPWARD
FE.TOWARDZERO
FE.TONEAREST
|
rounding.mode |
The rounding mode to set. It should be one of |
The rounding mode determines how the result of floating-point operations is treated when the result cannot be exactly represented in the significand. Various rounding modes are provided: round to nearest (the default), round up (towards positive infinity), round down (towards negative infinity), and round towards zero.
fesetround(rounding.mode)
sets the rounding mode and returns 0
if
it was successfull, 1
otherwise.
fegetround()
returns the current rounding mode.
Gianluca Amato amato@sci.unich.it
The fenv.3 Linux manpage maintainers
1 2 3 4 5 6 | fesetround(FE.UPWARD)
x <- 1/5
fesetround(FE.DOWNWARD)
y <- 1/5
print(x-y > 0)
fesetround(FE.TONEAREST)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.