2 base2 - set 2nd output base
13 By default, calc will output values according to the default base
14 as controlled by the base() builtin function.
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:
24 The arguments for base2() are identical to base() with the addition
30 2 "binary" base 2 fractions
33 8 "octal" base 8 fractions
36 10 "real" base 10 floating point
40 -10 "integer" base 10 integers
43 16 "hexadecimal" base 16 fractions
46 1/3 "fraction" base 10 fractions
49 1e20 "scientific" base 10 scientific notation
53 0 "off" disable double base output
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
59 These base2() calls have the same meaning as config("mode2", "fraction"):
61 base2(1/3) base2(0.1415) base2(16/37)
63 These base2() calls have the same meaning as config("mode2", "scientific"):
65 base2(1e20) base2(2^64) base2(2^8191-1)
67 However the base2() function will only return one of the base values
68 listed in the table above.
87 int math_setmode2(int newmode)
89 NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT,
90 MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY,
96 ## Copyright (C) 2002 Landon Curt Noll
98 ## Calc is open software; you can redistribute it and/or modify it under
99 ## the terms of the version 2.1 of the GNU Lesser General Public License
100 ## as published by the Free Software Foundation.
102 ## Calc is distributed in the hope that it will be useful, but WITHOUT
103 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
104 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
105 ## Public License for more details.
107 ## A copy of version 2.1 of the GNU Lesser General Public License is
108 ## distributed with calc under the filename COPYING-LGPL. You should have
109 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
110 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
112 ## @(#) $Revision: 30.1 $
113 ## @(#) $Id: base2,v 30.1 2007/03/16 11:10:42 chongo Exp $
114 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base2,v $
116 ## Under source code control: 2002/12/29 00:21:07
117 ## File existed as early as: 2002
119 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
120 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/