failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / btrunc
1 NAME
2     btrunc - truncate a value to a number of binary places
3
4 SYNOPSIS
5     btrunc(x [,plcs])
6
7 TYPES
8     x           real
9     plcs        integer, defaults to zero
10
11     return      real
12
13 DESCRIPTION
14     Truncate x to plcs binary places, rounding if necessary towards zero,
15     i.e. btrunc(x, plcs) is a multiple of 2^-plcs and the remainder
16     x - btrunc(x, plcs) is either zero or has the same sign as x and
17     absolute value less than 2^-plcs.  Here plcs may be positive, zero or
18     negative.
19
20     Except that it is defined only for real x, btrunc(x, plcs) is equivalent
21     to bround(x, plcs, 2).  btrunc(x,0) and btrunc(x) are equivalent to
22     int(x).
23
24 EXAMPLE
25     > print btrunc(pi()), btrunc(pi(), 10)
26     3 3.140625
27
28     > print btrunc(3.3), btrunc(3.7), btrunc(3.3, 2), btrunc(3.7, 2)
29     3 3 3.25 3.5
30
31     > print btrunc(-3.3), btrunc(-3.7), btrunc(-3.3, 2), btrunc(-3.7, 2)
32     -3 -3 -3.25 -3.5
33
34     > print btrunc(55.123, -4), btrunc(-55.123, -4)
35     48 -48
36
37 LIMITS
38     abs(j) < 2^31
39
40 LINK LIBRARY
41     NUMBER *qbtrunc(NUMBER *x, *j)
42
43 SEE ALSO
44     bround, int, round, trunc
45