failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / trunc
1 NAME
2     trunc - truncate a value to a number of decimal places
3
4 SYNOPSIS
5     trunc(x [,j])
6
7 TYPES
8     x           real
9     j           int
10
11     return      real
12
13 DESCRIPTION
14     Truncate x to j decimal places.  If j is omitted, 0 places is assumed.
15     Specifying zero places makes the result identical to int().
16
17     Truncation of a non-integer prodcues values nearer to zero.
18
19 EXAMPLE
20     > print trunc(pi()), trunc(pi(), 5)
21     3 3.14159
22
23     > print trunc(3.333), trunc(3.789), trunc(3.333, 2), trunc(3.789, 2)
24     3 3 3.33 3.78
25
26     > print trunc(-3.333), trunc(-3.789), trunc(-3.333, 2), trunc(-3.789, 2)
27     -3 -3 -3.33 -3.78
28
29 LIMITS
30     0 <= j < 2^31
31
32 LINK LIBRARY
33     NUMBER *qtrunc(NUMBER *x, *j)
34
35 SEE ALSO
36     bround, btrunc, int, round
37