trunc
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | trunc [2006/08/29 16:08] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: trunc.txt,v 1.2 2006/08/20 17:37:08 sthalik Exp $ | ||
+ | ======Synopsis: | ||
+ | $__trunc__(< | ||
+ | |||
+ | ======Technical: | ||
+ | This function truncates the given decimal number to the given precision, | ||
+ | rounding up or down as appropriate. | ||
+ | |||
+ | ======Practical: | ||
+ | This function is useful for rounding floating-point numbers. | ||
+ | used any time, though it is usually most useful when [[set FLOATING_POINT_MATH|FLOATING_POINT_MATH]] | ||
+ | is turned on. | ||
+ | |||
+ | ======Returns: | ||
+ | truncated number | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $trunc(0 3.141592654) | ||
+ | $trunc(2 3.141592654) | ||
+ | $trunc(5 3.54) returns " | ||
+ | </ | ||
trunc.txt · Last modified: 2006/08/29 16:08 by 127.0.0.1