failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / base2
1 NAME
2     base2 - set 2nd output base
3
4 SYNOPSIS
5     base2([mode])
6
7 TYPES
8     mode        real
9
10     return      real
11
12 DESCRIPTION
13     By default, calc will output values according to the default base
14     as controlled by the base() builtin function.
15
16     The base2() builtin function, if given a non-zero argument, enables
17     double base output mode.  In double base output mode, calc values
18     are displayed twice, once according to base() and again according
19     to base2().  In double base output mode, the second time a value is
20     displayed, it is displayed within comments:
21
22         21701 /* 0x54c5 */
23
24     The arguments for base2() are identical to base() with the addition
25     of the 0 value:
26
27              base2      equivalent
28                       config("mode2")'s
29
30                2        "binary"        base 2 fractions
31                         "bin"
32
33                8        "octal"         base 8 fractions
34                         "oct"
35
36               10        "real"          base 10 floating point
37                         "float"
38                         "default"
39
40              -10        "integer"       base 10 integers
41                         "int"
42
43               16        "hexadecimal"   base 16 fractions
44                         "hex"
45
46              1/3        "fraction"      base 10 fractions
47                         "frac"
48
49             1e20        "scientific"    base 10 scientific notation
50                         "sci"
51                         "exp"
52
53                0        "off"           disable double base output
54
55     For convenience, any non-integer non-zero value is assumed to mean
56     base 10 fractions and any integer >= 2^64 is assumed to mean base 10
57     scientific notation.
58
59     These base2() calls have the same meaning as config("mode2", "fraction"):
60
61         base2(1/3)      base2(0.1415)   base2(16/37)
62
63     These base2() calls have the same meaning as config("mode2", "scientific"):
64
65         base2(1e20)     base2(2^64)     base2(2^8191-1)
66
67     However the base2() function will only return one of the base values
68     listed in the table above.
69
70 EXAMPLE
71     > base2()
72             0
73     > base2(8)
74             0 /* 0 */
75     > print 10
76     10 /* 012 */
77     > base2(16),
78     > 131072
79         131072 /* 0x20000 */
80     > 2345
81         2345 /* 0x929 */
82
83 LIMITS
84     none
85
86 LINK LIBRARY
87     int math_setmode2(int newmode)
88
89     NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT,
90           MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY,
91           MODE2_OFF
92
93 SEE ALSO
94     base, config, str
95