📄 changes
字号:
Changed the help/config file to read like a builtin function help file. One can no longer set to 1, or to a value < 0, the config() parameters: "mul2", "sq2", "pow2", and "redc2". These values in the past would result in improper configuration of internal calc algorithms. Changed cal/test4100.cal to use the minimal value of 2 for "pow2", and "redc2". Changed the default values for the following config() parameters: config("mul2") == 1780 config("sq2") == 3388 config("pow2") == 176 These values were determined established on a 1.8GHz AMD 32-bit CPU of ~3406 BogoMIPS by the new resource file: cal/alg_config.cal Regarding the alg_config.cal resource file: The best_mul2() function returns the optimal value of config("mul2"). The best_sq2() function returns the optimal value of config("sq2"). The best_pow2() function returns the optimal value of config("pow2"). The other functions are just support functions. By design, best_mul2(), best_sq2(), and best_pow2() take a few minutes to run. These functions increase the number of times a given computational loop is executed until a minimum amount of CPU time is consumed. To watch these functions progress, one can set the config("user_debug") value. Here is a suggested way to use the alg_config.cal resource file: ; read alg_config ; config("user_debug",2),; ; best_mul2(); best_sq2(); best_pow2(); ; best_mul2(); best_sq2(); best_pow2(); ; best_mul2(); best_sq2(); best_pow2(); NOTE: It is perfectly normal for the optimal value returned to differ slightly from run to run. Slight variations due to inaccuracy in CPU timings will cause the best value returned to differ slightly from run to run. See "help resource" for more information on alg_config.cal. Updated the "help variable" text to reflect the current calc use of ` (backquote), * (star), and & (ampersand). Removal of some restrictions on the use of the same identifier for more than one of parameter, local, static or global variable. For example, at command level, one could use: for (local x = 0; x < 10; x++) print sqrt(x); At the beginning of a statement, "(global A)" is a way of indicating a reference to the variable A, whereas "global A" would be taken as a declaration. Parentheses are not required in "++global A" or "global A++" when "global" is used in this way. The patch extends this "specifier" (or "qualifier") feature to static variables, but such that "static A" refers only to a static variable at the current file and function scope levels. (If there is already a static variable A at the current file and function levels, a declaration statement "static A" would end the scope of that variable and define a new static variable with identifier A. A "global A" declaration is more drastic in that it ends the scope of any static variable A at the same or higher scope levels.) Unlike a static declaration in which an "initialization" occurs at most once, in the specifier case, "static A = expr" is simply an assignment which may be repeated any number of times. An example of its use is: define np() = static a = nextprime(a); For n not too large, the n-th call to this function will return the n-th prime. The variable a here will be private to the function. Because one can use "global", "local" or "static" to specify a type of variable, there seems little point in restricting the ways identifiers that can be used in more than one of these or as parameters. Obviously, introducing A as a local variable when it is being used as a parameter can lead to confusion and a warning is appropriate, but if it is to be used only occasionally, it might be convenient to be able to refer to it as "local A" rather than introducing another identifier. While it may be silly to use the same identifier for both a parameter and local variable, it should not be illegal. Added warnings for possibly questionable code in function definitions. Added config("redecl_warn", boolean) to control if calc issues warnings about variables being declared. The config("redecl_warn") value is TRUE by default. Added config("dupvar_warn", boolean) to control if calc issues warnings about when variable names collide. The config("dupvar_warn") value is TRUE by default. Examples of variable name collisions include when: * both local and static variables have the same name * both local and global variables have the same name * both function parameter and local variables have the same name * both function parameter and global variables have the same name Fix of a bug which causes some static variables not to be correctly unscoped when their identifiers are used in a global declaration. Change of "undefine" from a command-level keyword to statement level and introduction of an "undefine static A" statement to end the scope of a static variable A at the current file/function levels. Change/restored the syntax rules for "for" and "while" loops to recognize an unescaped newline in top-level command-level statements. Updated help/avg, help/define, help/fprintf, help/gcd, help/hash, help/hmean, help/lcm, help/max, help/min, help/null, help/poly, help/printf, help/ssq, help/strcat, help/strprintf, help/sum, help/xor. Changed the definition of the function ssq() to enable list arguments to be processed in the same way as in sum(). For example: ssq(1,2, list(3,4,list(5,6)), list(), 7, 8) returns the value of 1^2 + 2^2 + ... + 8^2 == 204. Added the calc resource sumtimes.cal, to give the runtimes for various ways of evaluating sums, sums of squares, etc, for large lists and matrices. For example: read sumtimes doalltimes(1e6) Calc now ignores carriage returns (\r), vertical tabs (\v), and form feeds (\f) when token parsing. Thus users on Windoz systems can write files using their \r\n format and users on non-Windoz systems can read them without errors. The quomod() builtin function now takes an optional 5th argument which controls the rounding mode like config("quomod") does, but only for that call. Now quomod() is in line with quo() and mod() in that the final argument is an optional rounding mode. Added a "make uninstall" rule which will attempt to remove everything that was installed by a "make install". Changed the "Copyright" line in the rpm spec file to a "License" line as per new rpm v4.4 syntax. The quomod() builtin function does not allow constants for its 3rd and 4th arguments. Updated the "help quomod" file and added more quomod regression tests. Added patch from Ernest Bowen <ebowen at une dot edu dot au> to add the builtin: estr(). The estr(x) will return a representation of a null, string, real number, complex number, list, matrix, object. block, named block, error as a string. Added patch from Ernest Bowen <ebowen at une dot edu dot au> to add the builtin: fgetfile(). The fgetfile(x) will return the rest of an open file as a string. Improved help files for fgetfield, fputs, name, or quomod.The following are the changes from calc version 2.11.10.1 to 2.11.11: Fixed a bug reported by the sourceforge user: cedars where: ln(exp(6)) == 3 /* WRONG!!! */ incorrectly returned 1. This bug was fixed by Ernest Bowen <ebowen at une dot edu dot au>. The regression test was expanded to cover this issue. Added minor improvements to hash regression testing of pi(). Fixed "help script" and the calc man page regarding the requirement of -f to be the last -flag in shell script mode. Further clarified the meaning and placement of the -f flag. Moved issues with chi.cal intfile.cal into a "mis-features" section of the BUGS file. See "help bugs" or the BUGS source file for details. Added the bug about: calc 'read ellip; efactor(13*17*19)' to the BUGS file. See "help bugs" or the BUGS source file for details. Anyone want to track down and fix this bug? Fixed typo in the "help mat" example and improved the mat_print example. Renamed most COMPLEX C function names to start with c_ to avoid conflicts with new C standard functions. Note that the calc builtin function names remain the same. The C function names inside the C source that calc is written in changed. This means that code that linked to libcalc.a will need to change in order to call calc's functions instead of the C standard functions. See cmath.h, comfunc.c, and commath.c for details. See also http://www.opengroup.org/onlinepubs/009695399/basedefs/complex.h.html for names of the new C standard functions. Changed the calc man page to note that using -- in the command will separate calc options from arguments as in: calc -p -- -1 - -7 Noted how Apple OS X can make use of readline in the Makefile. In particular: # For Apple OS X: install fink from http://fink.sourceforge.net # and then do a 'fink install readline' and then use: # READLINE_LIB= -L/sw/lib -lreadline -lhistory -lncurses Added linear.cal as a calc standard resource file.The following are the changes from calc version 2.11.10 to 2.11.10: The cygwin config value is correctly tested while doing comparisons between config states. Added config("compile_custom") to determine if calc was compiled with -DCUSTOM. By default, the Makefile uses ALLOW_CUSTOM= -DCUSTOM so by default, config("compile_custom") is TRUE. If, however, calc is compiled without -DCUSTOM, then config("compile_custom") will be FALSE. NOTE: The config("compile_custom") value is only affected by compile flags. The calc -D runtime command line option does not change the config("compile_custom") value. This is a read-only configuration value. Added config("allow_custom") to determine if the use of custom functions are allowed. To allow the use of custom functions, calc must be compiled with -DCUSTOM (which it is by default) AND calc run be run with the -D runtime command line option (which it is not by default). If config("allow_custom") is TRUE, then custom functions are allowed. If config("allow_custom") is FALSE, then custom functions are not allowed. This is a read-only configuration value. Correctly hash config state for windows and cygwin values. The value of config("compile_custom") and config("allow_custom") also affect the hash of the config state. Fixed the custom/argv.cal test code to avoid use of a reserved builtin function name. Fixed custom/*.cal scripts to conform better with the cal/*.cal resource files. Removed the Makefile variables ${LONGLONG_BITS}, ${HAVE_LONGLONG}, and ${L64_FORMAT}. Removed longlong.c and longlong.h. The use of HAVE_LONGLONG=0 was problematic. The lack of complaints about the HAVE_LONGLONG=0 shows that the 'long long' type is wide spread enough warrent not trying to support compilers without 'long long'. Removed the SVAL and SHVAL macros from zrand.c, zrand.h, and zmath.h as they were causing too many broken C pre-processors and C checkers to become confused. Added a 'make splint' rule to use the splint statically checking tool on the calc source. Removed support of the BSDI platform. The BSDI platform is no longer directly supported and we lost our last BSDI machine on which we could test calc. Best wishes to the former BSDI folk and thanks for breaking important ground in the Open Source Movement! Fixed several typos found in the documentation and buildin function output by C Smith <smichr at hotmail dot com>. Fixed -d so that: calc -d 2/3 will print 0.66666666666666666667 without the leading tilde as advertised in the man page. Added a missing help file for the display builtin function as requested by Igor Furlan <primorec at sbcglobal dot net>. Changed the "help environment" file to reflect modern default values of CALCPATH and CALCRC. Added missing variables for printing by the "make env" rule. Added EXT Makefile variable so that Cygwin can install calc as calc.exe. By default, EXT is empty so that calc is calc on most modern operating systems. Thanks goes to Ullal Devappa Kini <wmbfqj at vsnl dot net> for helping identify this problem and testing our fix. Added custom function: custom("pmodm127", q) to compute 2^(2^127-1) mod q. While currently slower than just doing pmod(2,2^127-1,q), it is added to give an example of a more complex custom function. Call calc with the -C flag to use custom functions. Made slight changes to the custom/HOW_TO_ADD documentation. Fixed some \ formatting man page problems as reported by Keh-Cheng Chu <kehcheng at quake dot Stanford dot edu>. Fixed some comparison between signed and unsigned in md5.c that was reported for the PowerMac G5 2GHz MacOS 10.3 by Guillaume VERGNAUD <vergnaud at via dot ecp dot fr>. Fixed a number of pending issues with help files filling in missing LIMITS, LINK LIBRARY, and SEE ALSO information,The following are the changes from calc version 2.11.9 to 2.11.9.3: Fixed calc man page examples to move -f to the end of the line. Thanks goes to Michael Somos <somos at grail dot cba dot csuohio dot edu> for pointing this out. Linux and gcc now compiled with -Wall -W -Wno-comment. Fixed a post increment that was reported by R. Trinler <trinler at web dot de> and fixed by Ernest Bowen <ernie at turing dot une dot edu dot au>. Fixed pi.cal to not depend on the buggy pre-2.11.9 post increment behavior.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -