⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calc.man

📁 早期freebsd实现
💻 MAN
字号:
.\".\" Copyright (c) 1994 David I. Bell and Landon Curt Noll.\" Permission is granted to use, distribute, or modify this source,.\" provided that this copyright notice remains intact..\".\" calculator by David I. Bell.\" man page by Landon Noll.TH calc 1 "^..^" "15nov93".SH NAME\f4calc\f1 \- arbitrary precision calculator.SH SYNOPSIS\f4calc\fP[\f4\-h\fP] [\f4\-q\fP] [.I calc_cmd\&.\|.\|.].SH DESCRIPTION\&.brCALC COMMAND LINE.PP.TP\f4 \-h\f1Print a help message.This option implies \f4 \-q\f1.This is equivalent to the calc command \f4help help\fP..TP\f4 \-q\f1Disable the use of the \f4$CALCRC\f1 startup library scripts..PPWithout \f4calc_cmd\fPs, \f4calc\fP operates interactively.If one or more \f4calc_cmd\fPs are given on the command line,\f4calc\fP will execute them and exit..PPNormally on startup, \f4calc\fP attempts to execute a collection of library scripts.The environment variable \f4$CALCRC\f1 (if non-existent thena compiled in value) contains a \f4:\fP separated list ofstartup library scripts.No error conditions are produced if these startup library scriptsare not found..PPFilenames are subject to ``~'' expansion (see below).The environment variable \f4$CALCPATH\fP (if non-existent thena compiled in value) contains a \f4:\fP separated list of searchdirectories.If a file does not begin with \f4/\fP, \f4~\fP or \f4./\fP,then it is searched for under each directory listed in the \f4$CALCPATH\fP.It is an error if no such readable file is found..PPFor more information use the following calc commands:.PP.in 1.0ihelp usage.brhelp help.brhelp environment.in -1.0i.PPOVERVIEW.PP\f4Calc\fP is arbitrary precision arithmetic system that uses a C-like language.\f4Calc\fP is useful as a calculator, an algorithm prototypedand as a mathematical research tool.More importantly, \f4calc\fP provides one with a machineindependent means of computation..PP\f4Calc\fP comes with a rich set of builtin mathematical and programmatic functions..PP\f4Calc\fP is distributed with library of scripts.Written in the same C-like language, library scripts may beread in and executed during a \f4calc\fP session.These library scripts are also provided because they areuseful and to serve as examples of the \f4calc\fP language.One may further extend \f4calc\fP thru theuse of user defined scripts..PPInternally calc represents numeric values as fractions reduced to theirlowest terms.The numerators and denominators of these factions may grow toarbitrarily large values.Numeric values read in are automatically converted into rationals.The user need not be aware of this internal representation..PPFor more information use the following calc commands:.PP.in 1.0ihelp intro.brhelp builtin.brhelp stdlib.brhelp define.brshow builtins.brshow functions.in -1.0i.PPDATA TYPES.PPFundamental builtin data types include integers, real numbers, rational numbers, complex numbers and strings..PPBy use of an object, one may define an arbitrarily complexdata types.One may define how such objects behave a wide range ofoperations such as addition, subtraction,multiplication, division, negation, squaring, modulus,rounding, exponentiation, equality, comparison, printingand so on..PPFor more information use the following calc commands:.PP.in 1.0ihelp types.brhelp obj.brshow objfuncs.in -1.0i.PPVARIABLES.PPVariables in \f4calc\fP are typeless.In other words, the fundamental type of a variable is determined by its content.Before a variable is assigned a value it has the value of zero..PPThe scope of a variable may be global, local to a file, or local to aprocedure.Values may be grouped together in a matrix, or into aa list that permits stack and queue style operations..PPFor more information use the following calc commands:.PP.in 1.0ihelp variable.brhelp mat.brhelp list.brshow globals.in -1.0i.PPINPUT/OUTPUT.PPA leading ``0x'' implies a hexadecimal value,a leading ``0b'' implies a binary value,and a ``0'' followed by a digit implies an octal value.Complex numbers are indicated by a trailing ``i'' such as in ``3+4i''.Strings may be delimited by either a pair of single or double quotes.By default, \f4calc\fP prints values as if they were floating point numbers.One may change the default to print values in a number of modesincluding fractions, integers and exponentials..PPA number of stdio-like file I/O operations are provided.One may open, read, write, seek and close files.Filenames are subject to ``\~'' expansion to home directoriesin a way similar to that of the Korn or C-Shell..PPFor example:.PP.in 1.0i~/.calcrc.br~chongo/lib/fft_multiply.cal.in -1.0i.PPFor more information use the following calc command:.PP.in 1.0ihelp file.in -1.0i.PPCALC LANGUAGE.PPThe \f4calc\fP language is a C-like language.The language includes commands such as variable declarations, expressions, tests, labels, loops, file operations, function calls.These commands are very similar to their counterparts in C..PPThe language also include a number of commands particularto \f4calc\fP itself.These include commands such as function definition, help, reading in library scripts, dump files to a file, error notification, configuration control and status..PPFor more information use the following calc command:.PP.in 1.0ihelp command.brhelp statement.brhelp expression.brhelp operator.brhelp config.in -1.0i.PP.SH FILES\&.br.PD 0.TP 20${LIBDIR}/*.callibrary scripts shipped with calc.br.sp.TP 20${LIBDIR}/help/*help files.br.sp.TP 20${LIBDIR}/bindingscommand line editor bindings.sp.SH ENVIRONMENT\&.br.PD 0.TP 5CALCPATHA :-separated list of directories used to search forscripts filenames that do not begin with /, ./ or ~..br.spDefault value: .:./lib:~/lib:${LIBDIR}.br.sp.TP 5CALCRCOn startup (unless \-h or \-q was given on the commandline), calc searches for files along this :-separatedenvironment variable..br.spDefault value: ${LIBDIR}/startup:~/.calcrc.br.sp.TP 5CALCBINDINGSOn startup (unless \-h or \-q was given on the commandline), calc reads key bindings from the filename specifiedby this environment variable..br.spDefault value: ${LIBDIR}/bindings.sp.SH CREDIT\&.brWritten by David I. Bell..spThanks for suggestions and encouragement from Peter Miller,Neil Justusson, and Landon Noll..spPortions of this program are derived from an earlier set ofpublic domain arbitrarily precision routines which was postedto the net around 1984.  By now, there is almost no recognizable code left from that original source..spMost of this source and binary is:.sp.PP.in 1.0iCopyright (c) 1994 David I. Bell.sp.in -1.0i.PPSome files are a copyrighted David I. Bell and Landon Noll..spPermission is granted to use, distribute, or modify this source,provided that this copyright notice remains intact..spSend calc comments, suggestions, bug fixes, enhancementsand interesting calc scripts that you would like you see included in future distributions to:.sp.PP.in 1.0idbell@canb.auug.org.au.brchongo@toad.com.sp.in -1.0i.PP.spEnjoy!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -