1NAME
2    config - configuration parameters
3
4SYNOPSIS
5    config(parameter [,value])
6
7TYPES
8    parameter	string
9    value	int, string, config state
10
11    return	config state
12
13DESCRIPTION
14    The config() builtin affects how the calculator performs certain
15    operations.	 Among features that are controlled by these parameters
16    are the accuracy of some calculations, the displayed format of results,
17    the choice from possible alternative algorithms, and whether or not
18    debugging information is displayed.	 The parameters are
19    read or set using the "config" built-in function; they remain in effect
20    until their values are changed by a config or equivalent instruction.
21
22    The following parameters can be specified:
23
24	    "all"		all configuration values listed below
25
26	    "trace"		turns tracing features on or off
27	    "display"		sets number of digits in prints.
28	    "epsilon"		sets error value for transcendental.
29	    "maxprint"		sets maximum number of elements printed.
30	    "mode"		sets printout mode.
31	    "mode2"		sets 2nd base printout mode.
32	    "mul2"		sets size for alternative multiply.
33	    "sq2"		sets size for alternative squaring.
34	    "pow2"		sets size for alternate powering.
35	    "redc2"		sets size for alternate REDC.
36	    "tilde"		enable/disable printing of the roundoff '~'
37	    "tab"		enable/disable printing of leading tabs
38	    "quomod"		sets rounding mode for quomod
39	    "quo"		sets rounding mode for //, default for quo
40	    "mod"		sets "rounding" mode for %, default for mod
41	    "sqrt"		sets rounding mode for sqrt
42	    "appr"		sets rounding mode for appr
43	    "cfappr"		sets rounding mode for cfappr
44	    "cfsim"		sets rounding mode for cfsim
45	    "round"		sets rounding mode for round and bround
46	    "outround"		sets rounding mode for printing of numbers
47	    "leadzero"		enables/disables printing of 0 as in 0.5
48	    "fullzero"		enables/disables padding zeros as in 0.5000
49	    "maxscan"		maximum number of scan errors before abort
50	    "prompt"		default interactive prompt
51	    "more"		default interactive multi-line input prompt
52	    "blkmaxprint"	number of block octets to print, 0 means all
53	    "blkverbose"	TRUE => print all lines, FALSE=>skip duplicates
54	    "blkbase"		block output base
55	    "blkfmt"		block output format
56	    "calc_debug"	controls internal calc debug information
57	    "resource_debug"	controls resource file debug information
58	    "user_debug"	for user defined debug information
59	    "verbose_quit"	TRUE => print message on empty quit or abort
60	    "ctrl_d"		The interactive meaning of ^D (Control D)
61	    "program"		Read-only calc program or shell script path
62	    "basename"		Read-only basename of the program value
63	    "windows"		Read-only indicator of MS windows
64	    "cygwin"		TRUE=>calc compiled with cygwin, Read-only
65	    "compile_custom"	TRUE=>calc was compiled with custom functions
66	    "allow_custom"	TRUE=>custom functions are enabled
67	    "version"		Read-only calc version
68	    "baseb"		bits in calculation base, a read-only value
69	    "redecl_warn"	TRUE => warn when redeclaring
70	    "dupvar_warn"	TRUE => warn when variable names collide
71	    "hz"		Read-only operating system tick rate or 0
72
73    The "all" config value allows one to save/restore the configuration
74    set of values.  The return of:
75
76	    config("all")
77
78    is a CONFIG type which may be used as the 2rd arg in a later call.
79    One may save, modify and restore the configuration state as follows:
80
81	    oldstate = config("all")
82	    ...
83	    config("tab", 0)
84	    config("mod", 10)
85	    ...
86	    config("all", oldstate)
87
88    This save/restore method is useful within functions.
89    It allows functions to control their configuration without impacting
90    the calling function.
91
92    There are two configuration state aliases that may be set.	To
93    set the backward compatible standard configuration:
94
95	    config("all", "oldstd")
96
97    The "oldstd" will restore the configuration to the default at startup.
98
99    A new configuration that some people prefer may be set by:
100
101	    config("all", "newstd")
102
103    The "newstd" is not backward compatible with the historic
104    configuration.  Even so, some people prefer this configuration
105    and place the config("all", "newstd") command in their CALCRC
106    startup files; newstd may also be established by invoking calc
107    with the flag -n.
108
109    The following are synonyms for true:
110
111	    "on"
112	    "true"
113	    "t"
114	    "yes"
115	    "y"
116	    "set"
117	    "1"
118	    any non-zero number
119
120    The following are synonyms for false:
121
122	    "off"
123	    "false"
124	    "f"
125	    "no"
126	    "n"
127	    "unset"
128	    "0"
129	    the number zero (0)
130
131    Examples of setting some parameters are:
132
133	    config("mode", "exp");	    exponential output
134	    config("display", 50);	    50 digits of output
135	    epsilon(epsilon() / 8);	    3 bits more accuracy
136	    config("tilde", 0)		    disable roundoff tilde printing
137	    config("tab", "off")	    disable leading tab printing
138
139    =-=
140
141    config("trace", bitflag)
142
143    When nonzero, the "trace" parameter activates one or more features
144    that may be useful for debugging.  These features correspond to
145    powers of 2 which contribute additively to config("trace"):
146
147	1: opcodes are displayed as functions are evaluated
148
149	2: disables the inclusion of debug lines in opcodes for functions
150	   whose definitions are introduced with a left-brace.
151
152	4: the number of links for real and complex numbers are displayed
153	   when the numbers are printed; for real numbers "#" or for
154	   complex numbers "##", followed by the number of links, are
155	   printed immediately after the number.
156
157	8: the opcodes for a new functions are displayed when the function
158	   is successfully defined.
159
160    See also resource_debug, calc_debug and user_debug below for more
161    debug levels.
162
163    =-=
164
165    config("display", int)
166
167    The "display" parameter specifies the maximum number of digits after
168    the decimal point to be printed in real, exponential or engineering
169    mode in normal unformatted printing (print, strprint, fprint) or in
170    formatted printing (printf, strprintf, fprintf) when precision is not
171    specified.	The initial value for oldstd is 20, for newstd 10.
172    The parameter may be changed to the value d by either
173    config("display", d) or by display (d).  This parameter does not change
174    the stored value of a number.  Where rounding is necessary to
175    display up to d decimal places, the type of rounding to be used is
176    controlled by config("outround").
177
178    =-=
179
180    config("epsilon", real)
181    epsilon(real)
182
183    The "epsilon" parameter specifies the default accuracy for the
184    calculation of functions for which exact values are not possible or
185    not desired.  For most functions, the
186
187		remainder = exact value - calculated value
188
189    has absolute value less than epsilon, but, except when the sign of
190    the remainder is controlled by an appropriate parameter, the
191    absolute value of the remainder usually does not exceed epsilon/2.
192    Functions which require an epsilon value accept an
193    optional argument which overrides this default epsilon value for
194    that single call.  The value v can be assigned to the "epsilon"
195    parameter by either config("epsilon", v) or epsilon(v); each of
196    these functions return the current epsilon value; config("epsilon")
197    or epsilon() returns but does not change the epsilon value.
198    For the transcendental functions and the functions sqrt() and
199    appr(), the calculated value is always a multiple of epsilon.
200
201    =-=
202
203    config("mode", "mode_string")
204    config("mode2", "mode_string")
205
206    The "mode" parameter is a string specifying the mode for printing of
207    numbers by the unformatted print functions, and the default
208    ("%d" specifier) for formatted print functions.  The initial mode
209    is "real".	The available modes are:
210
211	  config("mode")	meaning				equivalent
212	      string						base() call
213
214	    "binary"		base 2 fractions		base(2)
215	    "bin"
216
217	    "octal"		base 8 fractions		base(8)
218	    "oct"
219
220	    "real"		base 10 floating point		base(10)
221	    "float"
222	    "default"
223
224	    "integer"		base 10 integer			base(-10)
225	    "int"
226
227	    "hexadecimal"	base 16 fractions		base(16)
228	    "hex"
229
230	    "fraction"		base 10 fractions		base(1/3)
231	    "frac"
232
233	    "scientific"	base 10 scientific notation	base(1e20)
234	    "sci"
235	    "exp"
236
237	    "engineering"	base 10 notation with exponent	base(10e6)
238	    "eng"		multiple of 3
239
240    Where multiple strings are given, the first string listed is what
241    config("mode") will return.
242
243    The "mode2" controls the double base output.  When set to a value
244    other than "off", calc outputs files in both the "base" mode as
245    well as the "base2" mode.  The "mode2" value may be any of the
246    "mode" values with the addition of:
247
248	    "off"		disable 2nd base output mode	base2(0)
249
250    The base() builtin function sets and returns the "mode" value.
251    The base2() builtin function sets and returns the "mode2" value.
252
253    The default "mode" is "real".  The default "mode2" is "off".
254
255    =-=
256
257    config("maxprint", int)
258
259    The "maxprint" parameter specifies the maximum number of elements to
260    be displayed when a matrix or list is printed.  The initial value is 16.
261
262    =-=
263
264    config("mul2", int)
265    config("sq2", int)
266
267    Mul2 and sq2 specify the sizes of numbers at which calc switches
268    from its first to its second algorithm for multiplying and squaring.
269    The first algorithm is the usual method of cross multiplying, which
270    runs in a time of O(N^2).  The second method is a recursive and
271    complicated method which runs in a time of O(N^1.585).  The argument
272    for these parameters is the number of binary words at which the
273    second algorithm begins to be used.  The minimum value is 2, and
274    the maximum value is very large.  If 2 is used, then the recursive
275    algorithm is used all the way down to single digits, which becomes
276    slow since the recursion overhead is high.	If a number such as
277    1000000 is used, then the recursive algorithm is almost never used,
278    causing calculations for large numbers to slow down.
279
280    Units refer to internal calculation digits where each digit
281    is BASEB bits in length.  The value of BASEB is returned by
282    config("baseb").
283
284    The default value for config("sq2") is 3388.  This default was
285    established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
286    the two algorithms are about equal in speed.  For that CPU test,
287    config("baseb") was 32.  This means that by default numbers up to
288    (3388*32)+31 = 108447 bits in length (< 32645 decimal digits) use
289    the 1st algorithm, for squaring.
290
291    The default value for config("mul2") is 1780.  This default was
292    established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
293    the two algorithms are about equal in speed.  For that CPU test,
294    config("baseb") was 32.  This means that by default numbers up to
295    (1779*32)+31 = 56927 bits in length (< 17137 decimal digits) use
296    the 1st algorithm, for multiplication.
297
298    A value of zero resets the parameter back to their default values.
299
300    The value of 1 and values < 0 are reserved for future use.
301
302    Usually there is no need to change these parameters.
303
304    =-=
305
306    config("pow2", int)
307
308    Pow2 specifies the sizes of numbers at which calc switches from
309    its first to its second algorithm for calculating powers modulo
310    another number.  The first algorithm for calculating modular powers
311    is by repeated squaring and multiplying and dividing by the modulus.
312    The second method uses the REDC algorithm given by Peter Montgomery
313    which avoids divisions.  The argument for pow2 is the size of the
314    modulus at which the second algorithm begins to be used.
315
316    Units refer to internal calculation digits where each digit
317    is BASEB bits in length.  The value of BASEB is returned by
318    config("baseb").
319
320    The default value for config("pow2") is 176.  This default was
321    established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
322    the two algorithms are about equal in speed.  For that CPU test,
323    config("baseb") was 32.  This means that by default numbers up to
324    (176*32)+31 = 5663 bits in length (< 1704 decimal digits) use the
325    1st algorithm, for calculating powers modulo another number.
326
327    A value of zero resets the parameter back to their default values.
328
329    The value of 1 and values < 0 are reserved for future use.
330
331    Usually there is no need to change these parameters.
332
333    =-=
334
335    config("redc2", int)
336
337    Redc2 specifies the sizes of numbers at which calc switches from
338    its first to its second algorithm when using the REDC algorithm.
339    The first algorithm performs a multiply and a modular reduction
340    together in one loop which runs in O(N^2).	The second algorithm
341    does the REDC calculation using three multiplies, and runs in
342    O(N^1.585).	 The argument for redc2 is the size of the modulus at
343    which the second algorithm begins to be used.
344
345    Units refer to internal calculation digits where each digit
346    is BASEB bits in length.  The value of BASEB is returned by
347    config("baseb").
348
349    The default value for config("redc2") is 220.  This default was
350    established as 5/4 (the historical ratio of config("pow2") to
351    config("pow2")) of the config("pow2") value.  This means that if
352    config("baseb") is 32, then by default numbers up to (220*32)+31 =
353    7071 bits in length (< 2128 decimal digits) use the REDC algorithm,
354    for calculating powers modulo another number.
355
356    A value of zero resets the parameter back to their default values.
357
358    The value of 1 and values < 0 are reserved for future use.
359
360    Usually there is no need to change these parameters.
361
362    =-=
363
364    config("tilde", boolean)
365
366    Config("tilde") controls whether or not a leading tilde ('~') is
367    printed to indicate that a number has not been printed exactly
368    because the number of decimal digits required would exceed the
369    specified maximum number.  The initial "tilde" value is 1.
370
371    =-=
372
373    config("tab", boolean)
374
375    Config ("tab") controls the printing of a tab before results
376    automatically displayed when working interactively.	 It does not
377    affect the printing by the functions print, printf, etc.  The initial
378    "tab" value is 1.
379
380    =-=
381
382    config("quomod", bitflag)
383    config("quo", bitflag)
384    config("mod", bitflag)
385    config("sqrt", bitflag)
386    config("appr", bitflag)
387    config("cfappr", bitflag)
388    config("cfsim", bitflag)
389    config("outround", bitflag)
390    config("round", bitflag)
391
392    The "quomod", "quo", "mod", "sqrt", "appr", "cfappr", "cfsim", and
393    "round" control the way in which any necessary rounding occurs.
394    Rounding occurs when for some reason, a calculated or displayed
395    value (the "approximation") has to differ from the "true value",
396    e.g. for quomod and quo, the quotient is to be an integer, for sqrt
397    and appr, the approximation is to be a multiple of an explicit or
398    implicit "epsilon", for round and bround (both controlled by
399    config("round")) the number of decimal places or fractional bits
400    in the approximation is limited.  Zero value for any of these
401    parameters indicates that the true value is greater than the approximation,
402    i.e. the rounding is "down", or in the case of mod, that the
403    residue has the same sign as the divisor.  If bit 4 of the
404    parameter is set, the rounding of to the nearest acceptable candidate
405    when this is uniquely determined; in the remaining ambiguous cases,
406    the type of rounding is determined by the lower bits of the parameter
407    value.  If bit 3 is set, the rounding for quo, appr and sqrt,
408    is to the nearest even integer or the nearest even multiple of epsilon,
409    and for round to the nearest even "last decimal place".  The effects
410    of the 3 lowest bits of the parameter value are as follows:
411
412	Bit 0: Unconditional reversal (down to up, even to odd, etc.)
413	Bit 1: Reversal if the exact value is negative
414	Bit 2: Reversal if the divisor or epsilon is negative
415
416    (Bit 2 is irrelevant for the functions round and bround since the
417    equivalent epsilon (a power of 1/10 or 1/2) is always positive.)
418
419    For quomod, the quotient is rounded to an integer value as if
420    evaluating quo with config("quo") == config("quomod").  Similarly,
421    quomod and mod give the same residues if config("mod") == config("quomod").
422
423    For the sqrt function, if bit 5 of config("sqrt") is set, the exact
424    square-root is returned when this is possible; otherwise the
425    result is rounded to a multiple of epsilon as determined by the
426    five lower order bits.  Bit 6 of config("sqrt") controls whether the
427    principal or non-principal square-root is returned.
428
429    For the functions cfappr and cfsim, whether the "rounding" is down
430    or up, etc. is controlled by the appropriate bits of config("cfappr")
431    and config("cfsim") as for quomod, quo, etc.
432
433    The "outround" parameter determines the type of rounding to be used
434    by the various kinds of printing to the output: bits 0, 1, 3 and 4
435    are used in the same way as for the functions round and bround.
436
437    The C language method of modulus and integer division is:
438
439	    config("quomod", 2)
440	    config("quo", 2)
441	    config("mod", 2)
442
443    =-=
444
445    config("leadzero", boolean)
446
447    The "leadzero" parameter controls whether or not a 0 is printed
448    before the decimal point in non-zero fractions with absolute value
449    less than 1, e.g. whether 1/2 is printed as 0.5 or .5.   The
450    initial value is 0, corresponding to the printing .5.
451
452    =-=
453
454    config("fullzero", boolean)
455
456    The "fullzero" parameter controls whether or not in decimal floating-
457    point printing, the digits are padded with zeros to reach the
458    number of digits specified by config("display") or by a precision
459    specification in formatted printing.  The initial value for this
460    parameter is 0, so that, for example, if config("display") >= 2,
461    5/4 will print in "real" mode as 1.25.
462
463    =-=
464
465    config("maxscan", int)
466
467    The maxscan value controls how many scan errors are allowed
468    before the compiling phase of a computation is aborted.  The initial
469    value of "maxscan" is 20.  Setting maxscan to 0 disables this feature.
470
471    =-=
472
473    config("prompt", str)
474
475    The default prompt when in interactive mode is "> ".  One may change
476    this prompt to a more cut-and-paste friendly prompt by:
477
478	    config("prompt", "; ")
479
480    On windowing systems that support cut/paste of a line, one may
481    cut/copy an input line and paste it directly into input.  The
482    leading ';' will be ignored.
483
484    =-=
485
486    config("more", str)
487
488    When inside multi-line input, the more prompt is used.  One may
489    change it by:
490
491	    config("more", ";; ")
492
493    =-=
494
495    config("blkmaxprint", int)
496
497    The "blkmaxprint" config value limits the number of octets to print
498    for a block.  A "blkmaxprint" of 0 means to print all octets of a
499    block, regardless of size.
500
501    The default is to print only the first 256 octets.
502
503    =-=
504
505    config("blkverbose", boolean)
506
507    The "blkverbose" determines if all lines, including duplicates
508    should be printed.	If TRUE, then all lines are printed.  If false,
509    duplicate lines are skipped and only a "*" is printed in a style
510    similar to od.  This config value has not meaning if "blkfmt" is "str".
511
512    The default value for "blkverbose" is FALSE: duplicate lines are
513    not printed.
514
515    =-=
516
517    config("blkbase", "blkbase_string")
518
519    The "blkbase" determines the base in which octets of a block
520    are printed.  Possible values are:
521
522	"hexadecimal"		Octets printed in 2 digit hex
523	"hex"
524	"default"
525
526	"octal"			Octets printed in 3 digit octal
527	"oct"
528
529	"character"		Octets printed as chars with non-printing
530	"char"			    chars as \123 or \n, \t, \r
531
532	"binary"		Octets printed as 0 or 1 chars
533	"bin"
534
535	"raw"			Octets printed as is, i.e. raw binary
536	"none"
537
538    Where multiple strings are given, the first string listed is what
539    config("blkbase") will return.
540
541    The default "blkbase" is "hexadecimal".
542
543    =-=
544
545    config("blkfmt", "blkfmt_string")
546
547    The "blkfmt" determines for format of how block are printed:
548
549	"lines"		print in lines of up to 79 chars + newline
550	"line"
551
552	"strings"	print as one long string
553	"string"
554	"str"
555
556	"od_style"	print in od-like format, with leading offset,
557	"odstyle"	   followed by octets in the given base
558	"od"
559
560	"hd_style"	print in hex dump format, with leading offset,
561	"hdstyle"	   followed by octets in the given base, followed
562	"hd"		   by chars or '.' if no-printable or blank
563	"default"
564
565    Where multiple strings are given, the first string listed is what
566    config("blkfmt") will return.
567
568    The default "blkfmt" is "hd_style".
569
570    =-=
571
572    config("calc_debug", bitflag)
573
574    The "calc_debug" is intended for controlling internal calc routines
575    that test its operation, or collect or display information that
576    might be useful for debug purposes.	 Much of the output from these
577    will make sense only to calc wizards.   Zero value (the default for
578    both oldstd and newstd) of config("resource_debug") corresponds to
579    switching off all these routines.  For nonzero value, particular
580    bits currently have the following meanings:
581
582	n		Meaning of bit n of config("calc_debug")
583
584	0	outputs shell commands prior to execution
585
586	1	outputs currently active functions when a quit instruction
587		is executed
588
589	2	some details of hash states are included in the output
590		when these are printed
591
592	3	when a function constructs a block value, tests are
593		made that the result has the properties required for use of
594		that block, e.g. that the pointer to the start of the
595		block is not NULL, and that its "length" is not negative.
596		A failure will result in a runtime error.
597
598	4	Report on changes to the state of stdin as well as changes
599		to internal variables that control the setting and restoring
600		of stdin.
601
602	5	Report on changes to the run state of calc.
603
604	6	Report on rand() subtractive 100 shuffle generator issues.
605
606	7	Report on custom function issues.
607
608    Bits >= 8 are reserved for future use and should not be used at this time.
609
610    By default, "calc_debug" is 0.  The initial value may be overridden
611    by the -D command line option.
612
613    =-=
614
615    config("resource_debug", bitflag)
616    config("lib_debug", bitflag)
617
618    The "resource_debug" parameter is intended for controlling the possible
619    display of special information relating to functions, objects, and
620    other structures created by instructions in calc scripts.
621    Zero value of config("resource_debug") means that no such information
622    is displayed.  For other values, the non-zero bits which currently
623    have meanings are as follows:
624
625	n		Meaning of bit n of config("resource_debug")
626
627	0	When a function is defined, redefined or undefined at
628		interactive level, a message saying what has been done
629		is displayed.
630
631	1	When a function is defined, redefined or undefined during
632		the reading of a file, a message saying what has been done
633		is displayed.
634
635	2	Show func will display more information about a functions
636		arguments and argument summary information.
637
638	3	During execution, allow calc standard resource files
639		to output additional debugging information.
640
641    The value for config("resource_debug") in both oldstd and newstd
642    is 3, but if calc is invoked with the -d flag, its initial value
643    is zero.  Thus, if calc is started without the -d flag, until
644    config("resource_debug") is changed, a message will be output when
645    a function is defined either interactively or during the reading of
646    a file.
647
648    The name config("lib_debug") is equivalent to config("resource_debug")
649    and is included for backward compatibility.
650
651    By default, "resource_debug" is 3.	The -d flag changes this default to 0.
652    The initial value may be overridden by the -D command line option.
653
654    =-=
655
656    config("user_debug", int)
657
658    The "user_debug" is provided for use by users.  Calc ignores this value
659    other than to set it to 0 by default (for both "oldstd" and "newstd").
660    No calc code or standard resource should change this value.	 Users
661    should feel free to use it in any way.   In particular they may
662    use particular bits for special purposes as with "calc_debug", or
663    they may use it to indicate a debug level with larger values
664    indicating more stringent and more informative tests with presumably
665    slower operation or more memory usage, and a particular value (like
666    -1 or 0) corresponding to "no tests".
667
668    By default, "user_debug" is 0.  The initial value may be overridden
669    by the -D command line option.
670
671    =-=
672
673    config("verbose_quit", boolean)
674
675    The "verbose_quit" controls the print of the message:
676
677	quit or abort executed
678
679    when a non-interactive quit or abort without an argument is encountered.
680    A quit of abort without an argument does not display a message when
681    invoked at the interactive level.
682
683    By default, "verbose_quit" is false.
684
685    =-=
686
687    config("ctrl_d", "ctrl_d_string")
688
689    For calc that is using the calc binding (not GNU-readline) facility:
690
691	The "ctrl_d" controls the interactive meaning of ^D (Control D):
692
693	    "virgin_eof"  If ^D is the only character that has been typed
694	    "virgineof"	  on a line, then calc will exit.  Otherwise ^D
695	    "virgin"	  will act according to the calc binding, which
696	    "default"	  by default is a Emacs-style delete-char.
697
698	    "never_eof"	  The ^D never exits calc and only acts according
699	    "nevereof"	  calc binding, which by default is a Emacs-style
700	    "never"	  delete-char.
701
702	    "empty_eof"	  The ^D always exits calc if typed on an empty line.
703	    "emptyeof"	  This condition occurs when ^D either the first
704	    "empty"	  character typed, or when all other characters on
705			  the line have been removed (say by deleting them).
706
707	Where multiple strings are given, the first string listed is what
708	config("ctrl_d") will return.
709
710	Note that config("ctrl_d") actually controls each and every character
711	that is bound to ``delete_char''.  By default, ``delete_char'' is
712	Control D.  Any character(s) bound to ``delete_char'' will cause calc
713	to exit (or not exit) as directed by config("ctrl_d").
714
715	See the ``binding'' help for information on the default calc bindings.
716
717	The default "ctrl_d", without GNU-readline is "virgin_eof".
718
719    For calc that was compiled with the GNU-readline facility:
720
721	The "ctrl_d" controls the interactive meaning of ^D (Control D):
722
723	    "virgin_eof"  Same as "empty_eof"
724	    "virgineof"
725	    "virgin"
726	    "default"
727
728	    "never_eof"	  The ^D never exits calc and only acts according
729	    "nevereof"	  calc binding, which by default is a Emacs-style
730	    "never"	  delete-char.
731
732	    "empty_eof"	  The ^D always exits calc if typed on an empty line.
733	    "emptyeof"	  This condition occurs when ^D either the first
734	    "empty"	  character typed, or when all other characters on
735
736	Where multiple strings are given, the first string listed is what
737	config("ctrl_d") will return.
738
739	The default "ctrl_d", with GNU-readline is effectively "empty_eof".
740
741	Literally it is "virgin_eof", but since "virgin_eof" is the
742	same as "empty_eof", the default is effectively "empty_eof".
743
744    Emacs users may find the default behavior objectionable, particularly
745    when using the GNU-readline facility.  Such users may want to add the line:
746
747	config("ctrl_d", "never_eof"),;
748
749    to their ~/.calcrc startup file to prevent ^D from causing calc to exit.
750
751    =-=
752
753    config("program")		<== NOTE: This is a read-only config value
754
755    The full path to the calc program, or the calc shell script can be
756    obtained by:
757
758	config("program")
759
760    This config parameter is read-only and cannot be set.
761
762    =-=
763
764    config("basename")		<== NOTE: This is a read-only config value
765
766    The calc program, or the calc shell script basename can be obtained by:
767
768	config("basename")
769
770    The config("basename") is the config("program") without any leading
771    path.  If config("program") has a / in it, config("basename") is
772    everything after the last /, otherwise config("basename") is the
773    same as config("program").
774
775    This config parameter is read-only and cannot be set.
776
777    =-=
778
779    config("windows")		<== NOTE: This is a read-only config value
780
781    Returns TRUE if you are running on a MS windows system, false if you
782    are running on an operating system that does not hate you.
783
784    This config parameter is read-only and cannot be set.
785
786    =-=
787
788    config("cygwin")		<== NOTE: This is a read-only config value
789
790    Returns TRUE if you calc was compiled with cygwin, false otherwise.
791
792    This config parameter is read-only and cannot be set.
793
794    =-=
795
796    config("compile_custom")	<== NOTE: This is a read-only config value
797
798    Returns TRUE if you calc was compiled with -DCUSTOM.  By default,
799    the calc Makefile uses ALLOW_CUSTOM= -DCUSTOM so by default
800    config("compile_custom") is TRUE.  If, however, calc is compiled
801    without -DCUSTOM, then config("compile_custom") will be FALSE.
802
803    The config("compile_custom") value is only affected by compile
804    flags.   The calc -D runtime command line option does not change
805    the config("compile_custom") value.
806
807    See also config("allow_custom").
808
809    This config parameter is read-only and cannot be set.
810
811    =-=
812
813    config("allow_custom")	<== NOTE: This is a read-only config value
814
815    Returns TRUE if you custom functions are enabled.  To allow the use
816    of custom functions, calc must be compiled with -DCUSTOM (which it
817    is by default) AND calc run be run with the -D runtime command line
818    option (which it is not by default).
819
820    If config("allow_custom") is TRUE, then custom functions are allowed.
821    If config("allow_custom") is FALSE, then custom functions are not
822    allowed.
823
824    See also config("compile_custom").
825
826    This config parameter is read-only and cannot be set.
827
828    =-=
829
830    config("version")		<== NOTE: This is a read-only config value
831
832    The version string of the calc program can be obtained by:
833
834	config("version")
835
836    This config parameter is read-only and cannot be set.
837
838    =-=
839
840    config("baseb")		<== NOTE: This is a read-only config value
841
842    Returns the number of bits in the fundamental base in which
843    internal calculations are performed.  For example, a value of
844    32 means that calc will perform many internal calculations in
845    base 2^32 with digits that are 32 bits in length.
846
847    For libcalc programmers, this is the value of BASEB as defined
848    in the zmath.h header file.
849
850    This config parameter is read-only and cannot be set.
851
852    =-=
853
854    config("redecl_warn", boolean)
855
856    Config("redecl_warn") controls whether or not a warning is issued
857    when redeclaring variables.
858
859    The initial "redecl_warn" value is 1.
860
861    =-=
862
863    config("dupvar_warn", boolean)
864
865    Config("dupvar_warn") controls whether or not a warning is issued
866    when a variable name collides with an exist name of a higher scope.
867    Examples of collisions are when:
868
869	* both local and static variables have the same name
870	* both local and global variables have the same name
871	* both function parameter and local variables have the same name
872	* both function parameter and global variables have the same name
873
874    The initial "redecl_warn" value is 1.
875
876    =-=
877
878    config("hz")		<== NOTE: This is a read-only config value
879
880    Returns the rate at which the operating system advances the clock
881    on POSIX based systems.  Returns 0 on non-POSIX based systems.
882    The non-zero value returned is in Hertz.
883
884    This config parameter is read-only and cannot be set.
885
886EXAMPLE
887    ; current_cfg = config("all");
888    ; config("tilde", off),;
889    ; config("calc_debug", 15),;
890    ; config("all") == current_cfg
891	0
892    ; config("all", current_cfg),;
893    ; config("all") == current_cfg
894	1
895
896    ; config("version")
897		"2.12.0"
898
899    ; config("all")
900	mode            "real"
901	mode2           "off"
902	display         20
903	epsilon         0.00000000000000000001
904	trace           0
905	maxprint        16
906	mul2            20
907	sq2             20
908	pow2            40
909	redc2           50
910	tilde           1
911	tab             1
912	quomod          0
913	quo             2
914	mod             0
915	sqrt            24
916	appr            24
917	cfappr          0
918	cfsim           8
919	outround        24
920	round           24
921	leadzero        1
922	fullzero        0
923	maxscan         20
924	prompt          "; "
925	more            ";; "
926	blkmaxprint     256
927	blkverbose      0
928	blkbase         "hexadecimal"
929	blkfmt          "hd_style"
930	resource_debug  3
931	lib_debug       3
932	calc_debug      0
933	user_debug      0
934	verbose_quit    0
935	ctrl_d          "virgin_eof"
936	program         "calc"
937	basename        "calc"
938	windows         0
939	cygwin          0
940	compile_custom  1
941	allow_custom    0
942	version         "2.12.0"
943	baseb		32
944	redecl_warn	1
945	dupvar_warn	1
946	hz		100
947
948    ; display()
949	20
950    ; config("display", 50),;
951    ; display()
952	50
953
954    ; /*
955       * NOTE: When displaying many digits after the decimal point
956       *       be sure to set display(digits) (see 'help display') to
957       *       large enough AND to set epsilon(eps) (see 'help epsilon')
958       *       small enough (or if the function has a esp argument,
959       *       give a eps argument that is small enough) to display
960       *       the value correctly.
961       */
962    ; config("tilde", 1),;
963
964    ; ## NOTE: display has too few digits and epsilon is not small enough
965
966    ; config("display", 12),;		/* or display(12),; */
967    ; printf("%f\n", pi(1e-10));
968    3.1415926536
969    ; config("epsilon", 1e-10),;	/* or epsilon(1e-10),; */
970    ; printf("%f\n", pi());
971    3.1415926536
972
973    ; ## NOTE: display has too few digits yet epsilon is small enough
974
975    ; config("display", 12),;		/* or display(12),; */
976    ; printf("%f\n", pi(1e-72));
977    ~3.141592653590
978    ; config("epsilon", 1e-72),;	/* or epsilon(1e-72),; */
979    ; printf("%f\n", pi());
980    ~3.141592653590
981
982    ; ## NOTE: display has enough digits but epsilon is not small enough
983
984    ; config("display", 72),;		/* or display(72),; */
985    ; printf("%f\n", pi(1e-10));
986    3.1415926536
987    ; config("epsilon", 1e-10),;	/* or epsilon(1e-10),; */
988    ; printf("%f\n", pi());
989    3.1415926536
990
991    ; ## NOTE: display has enough digits and epsilon is small enough
992
993    ; config("display", 72),;		/* or display(72),; */
994    ; printf("%f\n", pi(1e-72));
995    3.141592653589793238462643383279502884197169399375105820974944592307816406
996    ; config("epsilon", 1e-72),;	/* or epsilon(1e-72),; */
997    ; printf("%f\n", pi());
998    3.141592653589793238462643383279502884197169399375105820974944592307816406
999
1000LIMITS
1001    none
1002
1003LINK LIBRARY
1004     none
1005
1006SEE ALSO
1007     custom, custom_cal, display, epsilon, fprintf, printf, strprintf, usage
1008
1009## Copyright (C) 1999-2007,2018,2021  Landon Curt Noll
1010##
1011## Calc is open software; you can redistribute it and/or modify it under
1012## the terms of the version 2.1 of the GNU Lesser General Public License
1013## as published by the Free Software Foundation.
1014##
1015## Calc is distributed in the hope that it will be useful, but WITHOUT
1016## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1017## or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU Lesser General
1018## Public License for more details.
1019##
1020## A copy of version 2.1 of the GNU Lesser General Public License is
1021## distributed with calc under the filename COPYING-LGPL.  You should have
1022## received a copy with calc; if not, write to Free Software Foundation, Inc.
1023## 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
1024##
1025## Under source code control:	1991/07/21 04:37:17
1026## File existed as early as:	1991
1027##
1028## chongo <was here> /\oo/\	http://www.isthe.com/chongo/
1029## Share and enjoy!  :-)	http://www.isthe.com/chongo/tech/comp/calc/
1030