mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Release calc version 2.12.0.3
This commit is contained in:
195
help/config
195
help/config
@@ -1,12 +1,24 @@
|
||||
Configuration parameters
|
||||
NAME
|
||||
config - configuration parameters
|
||||
|
||||
Configuration parameters affect how the calculator performs certain
|
||||
SYNOPSIS
|
||||
config(parameter [,value])
|
||||
|
||||
TYPES
|
||||
parameter string
|
||||
value int, string, config state
|
||||
|
||||
return config state
|
||||
|
||||
DESCRIPTION
|
||||
The config() builtin affects how the calculator performs certain
|
||||
operations. Among features that are controlled by these parameters
|
||||
are the accuracy of some calculations, the displayed format of results,
|
||||
the choice from possible alternative algorithms, and whether or not
|
||||
debugging information is displayed. The parameters are
|
||||
read or set using the "config" built-in function; they remain in effect
|
||||
until their values are changed by a config or equivalent instruction.
|
||||
|
||||
The following parameters can be specified:
|
||||
|
||||
"all" all configuration values listed below
|
||||
@@ -53,6 +65,7 @@ Configuration parameters
|
||||
"compile_custom" TRUE=>calc was compiled with custom functions
|
||||
"allow_custom" TRUE=>custom functions are enabled
|
||||
"version" Read-only calc version
|
||||
"baseb" bits in calculation base, a read-only value
|
||||
|
||||
The "all" config value allows one to save/restore the configuration
|
||||
set of values. The return of:
|
||||
@@ -120,9 +133,6 @@ Configuration parameters
|
||||
config("tilde", 0) disable roundoff tilde printing
|
||||
config("tab", "off") disable leading tab printing
|
||||
|
||||
|
||||
Detailed config descriptions
|
||||
|
||||
=-=
|
||||
|
||||
config("trace", bitflag)
|
||||
@@ -254,16 +264,36 @@ Detailed config descriptions
|
||||
runs in a time of O(N^2). The second method is a recursive and
|
||||
complicated method which runs in a time of O(N^1.585). The argument
|
||||
for these parameters is the number of binary words at which the
|
||||
second algorithm begins to be used. The minimum value is 2, and
|
||||
second algorithm begins to be used. The minimum value is 2, and
|
||||
the maximum value is very large. If 2 is used, then the recursive
|
||||
algorithm is used all the way down to single digits, which becomes
|
||||
slow since the recursion overhead is high. If a number such as
|
||||
1000000 is used, then the recursive algorithm is never used, causing
|
||||
calculations for large numbers to slow down. For a typical example
|
||||
on a 386, the two algorithms are about equal in speed for a value
|
||||
of 20, which is about 100 decimal digits. A value of zero resets
|
||||
the parameter back to its default value. Usually there is no need
|
||||
to change these parameters.
|
||||
1000000 is used, then the recursive algorithm is almost never used,
|
||||
causing calculations for large numbers to slow down.
|
||||
|
||||
Units refer to internal calculation digits where each digit
|
||||
is BASEB bits in length. The value of BASEB is returned by
|
||||
config("baseb").
|
||||
|
||||
The default value for config("sq2") is 3388. This default was
|
||||
established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
|
||||
the two algorithms are about equal in speed. For that CPU test,
|
||||
config("baseb") was 32. This means that by default numbers up to
|
||||
(3388*32)+31 = 108447 bits in length (< 32645 decinal digits) use
|
||||
the 1st algorithm, for squaring.
|
||||
|
||||
The default value for config("mul2") is 1780. This default was
|
||||
established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
|
||||
the two algorithms are about equal in speed. For that CPU test,
|
||||
config("baseb") was 32. This means that by default numbers up to
|
||||
(1779*32)+31 = 56927 bits in length (< 17137 decinal digits) use
|
||||
the 1st algorithm, for multiplication.
|
||||
|
||||
A value of zero resets the parameter back to their default values.
|
||||
|
||||
The value of 1 and values < 0 are reserved for future use.
|
||||
|
||||
Usually there is no need to change these parameters.
|
||||
|
||||
=-=
|
||||
|
||||
@@ -277,6 +307,23 @@ Detailed config descriptions
|
||||
which avoids divisions. The argument for pow2 is the size of the
|
||||
modulus at which the second algorithm begins to be used.
|
||||
|
||||
Units refer to internal calculation digits where each digit
|
||||
is BASEB bits in length. The value of BASEB is returned by
|
||||
config("baseb").
|
||||
|
||||
The default value for config("pow2") is 176. This default was
|
||||
established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS when
|
||||
the two algorithms are about equal in speed. For that CPU test,
|
||||
config("baseb") was 32. This means that by default numbers up to
|
||||
(176*32)+31 = 5663 bits in length (< 1704 decinal digits) use the
|
||||
1st algorithm, for calculating powers modulo another number.
|
||||
|
||||
A value of zero resets the parameter back to their default values.
|
||||
|
||||
The value of 1 and values < 0 are reserved for future use.
|
||||
|
||||
Usually there is no need to change these parameters.
|
||||
|
||||
=-=
|
||||
|
||||
config("redc2", int)
|
||||
@@ -289,6 +336,23 @@ Detailed config descriptions
|
||||
O(N^1.585). The argument for redc2 is the size of the modulus at
|
||||
which the second algorithm begins to be used.
|
||||
|
||||
Units refer to internal calculation digits where each digit
|
||||
is BASEB bits in length. The value of BASEB is returned by
|
||||
config("baseb").
|
||||
|
||||
The default value for config("redc2") is 220. This default was
|
||||
established as 5/4 (the historical ratio of config("pow2") to
|
||||
config("pow2")) of the config("pow2") value. This means that if
|
||||
config("baseb") is 32, then by default numbers up to (220*32)+31 =
|
||||
7071 bits in length (< 2128 decinal digits) use the REDC algorithm,
|
||||
for calculating powers modulo another number.
|
||||
|
||||
A value of zero resets the parameter back to their default values.
|
||||
|
||||
The value of 1 and values < 0 are reserved for future use.
|
||||
|
||||
Usually there is no need to change these parameters.
|
||||
|
||||
=-=
|
||||
|
||||
config("tilde", boolean)
|
||||
@@ -560,11 +624,12 @@ Detailed config descriptions
|
||||
3 During execution, allow calc standard resource files
|
||||
to output additional debugging information.
|
||||
|
||||
The value for config("resource_debug") in both oldstd and newstd is 3,
|
||||
but if calc is invoked with the -d flag, its initial value is zero.
|
||||
Thus, if calc is started without the -d flag, until config("resource_debug")
|
||||
is changed, a message will be output when a function is defined
|
||||
either interactively or during the reading of a file.
|
||||
The value for config("resource_debug") in both oldstd and newstd
|
||||
is 3, but if calc is invoked with the -d flag, its initial value
|
||||
is zero. Thus, if calc is started without the -d flag, until
|
||||
config("resource_debug") is changed, a message will be output when
|
||||
a function is defined either interactively or during the reading of
|
||||
a file.
|
||||
|
||||
The name config("lib_debug") is equivalent to config("resource_debug")
|
||||
and is included for backward compatibility.
|
||||
@@ -601,7 +666,7 @@ Detailed config descriptions
|
||||
A quit of abort without an argument does not display a message when
|
||||
invoked at the interactive level.
|
||||
|
||||
By deafult, "verbose_quit" is false.
|
||||
By default, "verbose_quit" is false.
|
||||
|
||||
=-=
|
||||
|
||||
@@ -756,7 +821,95 @@ Detailed config descriptions
|
||||
|
||||
This config parameter is read-only and cannot be set.
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
=-=
|
||||
|
||||
config("baseb") <== NOTE: This is a read-only config value
|
||||
|
||||
Returns the number of bits in the fundamental base in which
|
||||
internal calculations are performed. For example, a value of
|
||||
32 means that calc will perform many internal calculations in
|
||||
base 2^32 with digits that are 32 bits in length.
|
||||
|
||||
For libcalc programmers, this is the value of BASEB as defined
|
||||
in the zmath.h header file.
|
||||
|
||||
This config parameter is read-only and cannot be set.
|
||||
|
||||
EXAMPLE
|
||||
; current_cfg = config("all");
|
||||
; config("tilde", off),;
|
||||
; config("calc_debug", 15),;
|
||||
; config("all") == current_cfg
|
||||
0
|
||||
; config("all", current_cfg),;
|
||||
; config("all") == current_cfg
|
||||
1
|
||||
|
||||
; config("version")
|
||||
"2.12.0"
|
||||
|
||||
; config("all")
|
||||
mode "real"
|
||||
mode2 "off"
|
||||
display 20
|
||||
epsilon 0.00000000000000000001
|
||||
trace 0
|
||||
maxprint 16
|
||||
mul2 20
|
||||
sq2 20
|
||||
pow2 40
|
||||
redc2 50
|
||||
tilde 1
|
||||
tab 1
|
||||
quomod 0
|
||||
quo 2
|
||||
mod 0
|
||||
sqrt 24
|
||||
appr 24
|
||||
cfappr 0
|
||||
cfsim 8
|
||||
outround 24
|
||||
round 24
|
||||
leadzero 1
|
||||
fullzero 0
|
||||
maxscan 20
|
||||
prompt "; "
|
||||
more ";; "
|
||||
blkmaxprint 256
|
||||
blkverbose 0
|
||||
blkbase "hexadecimal"
|
||||
blkfmt "hd_style"
|
||||
resource_debug 3
|
||||
lib_debug 3
|
||||
calc_debug 0
|
||||
user_debug 0
|
||||
verbose_quit 0
|
||||
ctrl_d "virgin_eof"
|
||||
program "calc"
|
||||
basename "calc"
|
||||
windows 0
|
||||
cygwin 0
|
||||
compile_custom 1
|
||||
allow_custom 0
|
||||
version "2.12.0"
|
||||
baseb 32
|
||||
|
||||
; display()
|
||||
20
|
||||
; config("display", 50),;
|
||||
; display()
|
||||
50
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
n/a
|
||||
|
||||
SEE ALSO
|
||||
usage, custom, custom_cal, usage, epsilon, display
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
##
|
||||
## Calc is open software; you can redistribute it and/or modify it under
|
||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
@@ -772,8 +925,8 @@ Detailed config descriptions
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.10 $
|
||||
## @(#) $Id: config,v 29.10 2004/07/27 23:45:52 chongo Exp $
|
||||
## @(#) $Revision: 29.15 $
|
||||
## @(#) $Id: config,v 29.15 2006/06/11 07:22:05 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/config,v $
|
||||
##
|
||||
## Under source code control: 1991/07/21 04:37:17
|
||||
|
Reference in New Issue
Block a user