hgk:round
Differences
This shows you the differences between two versions of the page.
hgk:round [2014/07/29 16:20] – created michfiel | hgk:round [2015/11/19 15:19] (current) – removed michfiel | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== round ==== | ||
- | |||
- | http:// | ||
- | \\ | ||
- | round() Returns the integral value that is nearest to x, with halfway cases rounded away from zero \\ | ||
- | floor() Rounds x downward, returning the largest integral value that is not greater than x \\ | ||
- | ceil() Rounds x upward, returning the smallest integral value that is not less than x \\ | ||
- | trunc() The nearest integral value that is not larger in magnitude than x (as a floating-point value) \\ | ||
- | \\ | ||
- | |||
- | ^ value^ | ||
- | | 2.3| 2.0| 2.0| 3.0| 2.0| | ||
- | | 3.8| 4.0| 3.0| 4.0| 3.0| | ||
- | | 5.5| 6.0| 5.0| 6.0| 5.0| | ||
- | | -2.3| -2.0| -3.0| -2.0| -2.0| | ||
- | | -3.8| -4.0| -4.0| -3.0| -3.0| | ||
- | | -5.5| -6.0| -6.0| -5.0| -5.0| | ||
- | |||
- | |||
- | * rint() Rounds x to an integral value, using the rounding direction specified by fegetround | ||
- | * near() The value of x rounded to a nearby integral (as a floating-point value) | ||
- | |||
- | |||
hgk/round.1406643658.txt.gz · Last modified: 2014/07/29 16:20 by michfiel