failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / digits
1 NAME
2     digits - return number of "decimal" digits in an integral part
3
4 SYNOPSIS
5     digits(x [,b])
6
7 TYPES
8     x           real
9     b           integer >= 2, defaults to 10
10
11     return      integer
12
13 DESCRIPTION
14     Returns number of digits in the standard base-b representation
15     when x is truncated to an integer and the sign is ignored.
16
17     To be more precise: when abs(int(x)) > 0, this function returns
18     the value 1 + ilog(x, b).  When abs(int(x)) == 0, then this
19     function returns the value 1.
20
21     If omitted, b is assumed to be 10.  If given, b must be an
22     integer > 1.
23
24     One should remember these special cases:
25
26         digits(12.3456) == 2    computes with the integer part only
27         digits(-1234) == 4      computes with the absolute value only
28         digits(0) == 1          specical case
29         digits(-0.123) == 1     combination of all of the above
30
31 EXAMPLE
32     > print digits(100), digits(23209), digits(2^72)
33     3 5 22
34
35     > print digits(0), digits(1), digits(-1)
36     1 1 1
37
38     > print digits(-1234), digits(12.3456), digits(107.207)
39     4 2 3
40
41     > print digits(17^463-1, 17), digits(10000, 100), digits(21701, 2)
42     3, 15 14
43
44 LIMITS
45     b > 1
46
47 LINK LIBRARY
48     long qdigits(NUMBER *q, ZVALUE base)
49
50 SEE ALSO
51     digit, places
52