mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Improve help files
Minor improvement of various help files. Made format of help files more consistent.
This commit is contained in:
6
help/abs
6
help/abs
@@ -6,8 +6,8 @@ SYNOPSIS
|
||||
|
||||
TYPES
|
||||
If x is an object of type xx, the function xx_abs has to have
|
||||
been defined; this will determine the types for x, eps and
|
||||
the returned value.
|
||||
been defined; this will determine the types for x, eps and
|
||||
the returned value.
|
||||
|
||||
For non-object x and eps:
|
||||
|
||||
@@ -44,7 +44,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
cmp, epsilon, hypot, norm, near, obj
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -20,8 +20,8 @@ DESCRIPTION
|
||||
'w' or bit 1 for writing, 'x' or bit 0 for execution.
|
||||
|
||||
EXAMPLE
|
||||
The system error-numbers and messages may differ for different
|
||||
implementations
|
||||
; ## The system error-numbers and messages may differ
|
||||
; ## for different implementations
|
||||
|
||||
; !rm -f junk
|
||||
; access("junk")
|
||||
@@ -48,7 +48,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
fopen, fclose, isfile, files
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print acot(2, 1e-5), acot(2, 1e-10), acot(2, 1e-15), acot(2, 1e-20)
|
||||
.46365 .463647609 .463647609000806 .46364760900080611621
|
||||
0.46365 0.463647609 0.463647609000806 0.46364760900080611621
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -29,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asin, acos, atan, asec, acsc, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -20,7 +20,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print acoth(2, 1e-5), acoth(2, 1e-10), acoth(2, 1e-15), acoth(2, 1e-20)
|
||||
.54931 .5493061443 .549306144334055 .5493061443340548457
|
||||
0.54931 0.5493061443 0.549306144334055 0.5493061443340548457
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -31,7 +31,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asinh, acosh, atanh, asech, acsch, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print acsc(2, 1e-5), acsc(2, 1e-10), acsc(2, 1e-15), acsc(2, 1e-20)
|
||||
.5236 .5235987756 .523598775598299 .52359877559829887308
|
||||
0.5236 0.5235987756 0.523598775598299 0.52359877559829887308
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -29,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asin, acos, atan, asec, acot, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,10 +18,9 @@ DESCRIPTION
|
||||
|
||||
acsch(x) = ln((1 + sqrt(1 + x^2))/x)
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print acsch(2, 1e-5), acsch(2, 1e-10), acsch(2, 1e-15), acsch(2, 1e-20)
|
||||
.48121 .4812118251 .481211825059603 .4812118250596034475
|
||||
0.48121 0.4812118251 0.481211825059603 0.4812118250596034475
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -32,7 +31,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asinh, acosh, atanh, asech, acoth, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
3
help/agd
3
help/agd
@@ -33,7 +33,6 @@ DESCRIPTION
|
||||
|
||||
agd(z) = atanh(sin(x)/cosh(y)) + i * atan(sinh(y)/cos(x)>
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print agd(1, 1e-5), agd(1, 1e-10), agd(1, 1e-15)
|
||||
1.22619 1.2261911709 1.226191170883517
|
||||
@@ -45,7 +44,7 @@ EXAMPLE
|
||||
-1.93237 -1.9323667197 -1.932366719745925
|
||||
|
||||
; print agd(1+2i, 1e-5), agd(1+2i, 1e-10)
|
||||
.22751+1.42291i .2275106584+1.4229114625i
|
||||
0.22751+1.42291i 0.2275106584+1.4229114625i
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
18
help/appr
18
help/appr
@@ -96,7 +96,7 @@ PROPERTIES
|
||||
|
||||
If y is nonzero, appr(x,y,8)/y = an odd integer n only if x = n * y.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
; print appr(-5.44,0.1,0), appr(5.44,0.1,0), appr(5.7,1,0), appr(-5.7,1,0)
|
||||
-5.5 5.4 5 -6
|
||||
|
||||
@@ -119,26 +119,26 @@ EXAMPLES
|
||||
-5.5 5.5 5 -5
|
||||
|
||||
; print appr(-.44,0.1,11), appr(.44,0.1,11), appr(5.7,1,11), appr(-5.7,1,11)
|
||||
-.4 .5 5 -6
|
||||
-0.4 0.5 5 -6
|
||||
|
||||
; print appr(-.44,-.1,11),appr(.44,-.1,11),appr(5.7,-1,11),appr(-5.7,-1,11)
|
||||
-.5 .4 6 -5
|
||||
-0.5 0.4 6 -5
|
||||
|
||||
; print appr(-.44,0.1,12), appr(.44,0.1,12), appr(5.7,1,12), appr(-5.7,1,12)
|
||||
-.4 .5 5 -6
|
||||
-0.4 0.5 5 -6
|
||||
|
||||
; print appr(-.44,-.1,12),appr(.44,-.1,12),appr(5.7,-1,12),appr(-5.7,-1,12)
|
||||
-.5 .4 6 -5
|
||||
-0.5 0.4 6 -5
|
||||
|
||||
; print appr(-.44,0.1,15), appr(.44,0.1,15), appr(5.7,1,15), appr(-5.7,1,15)
|
||||
-.4 .5 5 -6
|
||||
-0.4 0.5 5 -6
|
||||
|
||||
; print appr(-.44,-.1,15),appr(.44,-.1,15),appr(5.7,-1,15),appr(-5.7,-1,15)
|
||||
-.4 .5 5 -6
|
||||
-0.4 0.5 5 -6
|
||||
|
||||
; x = sqrt(7-3i, 1e-20)
|
||||
; print appr(x,1e-5,0), appr(x,1e-5,1), appr(x,1e-5,2), appr(x,1e-6,3)
|
||||
2.70331-.55488i 2.70332-.55487i 2.70331-.55487i 2.70332-.55488i
|
||||
2.70331-0.55488i 2.70332-0.55487i 2.70331-0.55487i 2.70332-0.55488i
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -151,7 +151,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
round, bround, cfappr, cfsim
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
4
help/arg
4
help/arg
@@ -17,7 +17,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print arg(2), arg(2+3i, 1e-5), arg(2+3i, 1e-10), arg(2+3i, 1e-20)
|
||||
0 .98279 .9827937232 .98279372324732906799
|
||||
0 0.98279 0.9827937232 0.98279372324732906799
|
||||
|
||||
; pi = pi(1e-10); deg = pi/180; eps = deg/10000
|
||||
; print arg(2+3i, eps)/deg, arg(-1 +1i, eps)/deg, arg(-1 - 1i,eps)/deg
|
||||
@@ -32,7 +32,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
conj, im, polar, re
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
15
help/arrow
15
help/arrow
@@ -22,24 +22,23 @@ DESCRIPTION
|
||||
|
||||
Spaces or tabs on either side of -> are optional.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
; obj pair {one, two}
|
||||
; obj pair A, B
|
||||
; obj pair A; obj pair B
|
||||
; p = &A
|
||||
; p->one = 1; p->two = 2
|
||||
; A
|
||||
obj pair {1, 2}
|
||||
obj pair {1, 2}
|
||||
|
||||
; A->two = &B
|
||||
; p->two->one = 3; p->two->two = 4
|
||||
; p->one = 3; p->two = 4
|
||||
|
||||
; *p->ptwo
|
||||
; *p
|
||||
obj pair {3, 4}
|
||||
|
||||
; B = {5,6}
|
||||
; *p->two
|
||||
obj pair {5, 6}
|
||||
|
||||
4
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -50,7 +49,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
address, dereference, isptr, dot
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -29,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asin, acos, atan, acsc, acot, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print asin(.5, 1e-5), asin(.5, 1e-10), asin(.5, 1e-15), asin(.5, 1e-20)
|
||||
.5236 .5235987756 .523598775598299 .52359877559829887308
|
||||
0.5236 0.5235987756 0.523598775598299 0.52359877559829887308
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -29,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
acos, atan, asec, acsc, acot, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -74,7 +74,6 @@ DESCRIPTION
|
||||
results in the value 3 being stored not only as the new value for A
|
||||
but also at the now unnamed location earlier used for A[0].
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; b = 3+1
|
||||
; a = b
|
||||
|
14
help/assoc
14
help/assoc
@@ -66,12 +66,12 @@ EXAMPLE
|
||||
; A["zero"] = 0; A["one"] = 1; A["two"] = 2; A["three"] = 3;
|
||||
; A["smallest", "prime"] = 2;
|
||||
; print A
|
||||
assoc (5 elements);
|
||||
["two"] = 2
|
||||
["three"] = 3
|
||||
["one"] = 1
|
||||
["zero"] = 0
|
||||
["smallest","prime"] = 2
|
||||
assoc (5 elements);
|
||||
["two"] = 2
|
||||
["three"] = 3
|
||||
["one"] = 1
|
||||
["zero"] = 0
|
||||
["smallest","prime"] = 2
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -82,7 +82,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
isassoc, rsearch, search, size
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -25,7 +25,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print atan2(0,0), atan2(1,sqrt(3)), atan2(17,53,1e-100)
|
||||
0 ~.52359877559829887307 ~.31038740713235146535
|
||||
0 ~0.52359877559829887307 ~0.31038740713235146535
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -36,7 +36,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
acos, asin, atan, cos, epsilon, sin, tan
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -20,7 +20,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print atanh(.5,1e-5), atanh(.5,1e-10), atanh(.5,1e-15), atanh(.5,1e-20)
|
||||
.54931 .5493061443 .549306144334055 .5493061443340548457
|
||||
0.54931 0.5493061443 0.549306144334055 0.5493061443340548457
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -31,7 +31,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
asinh, acosh, asech, acsch, acoth, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
10
help/avg
10
help/avg
@@ -35,10 +35,10 @@ EXAMPLE
|
||||
; avg(x,y)
|
||||
|
||||
mat [2,2] (4 elements, 4 nonzero):
|
||||
[0,0] = 1
|
||||
[0,1] = 2
|
||||
[1,0] = 3.5
|
||||
[1,1] = 6
|
||||
[0,0] = 1
|
||||
[0,1] = 2
|
||||
[1,0] = 3.5
|
||||
[1,1] = 6
|
||||
|
||||
LIMITS
|
||||
The number of arguments is not to exceed 1024.
|
||||
@@ -49,7 +49,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
hmean
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -106,7 +106,6 @@ DESCRIPTION
|
||||
and dsi refer to the double-bracket method of indexing, i.e. the
|
||||
matrix is as if its elements were indexed 0, 1, ..., size(M) - 1.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; A = blk() = {1,2,3,4}
|
||||
; B = blk()
|
||||
@@ -190,7 +189,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
blk, mat, file, list, str
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -19,7 +19,6 @@ DESCRIPTION
|
||||
of their creation.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
; A = blk("alpha")
|
||||
; B = blk("beta") = {1,2,3}
|
||||
; blocks()
|
||||
@@ -42,7 +41,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
blk, blkfree
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
32
help/bround
32
help/bround
@@ -65,29 +65,29 @@ DESCRIPTION
|
||||
changed by assignments; plcs and rnd are copied to temporary
|
||||
variables, so their values are not changed by the call.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
; a = 7/32, b = -7/32
|
||||
|
||||
; print a, b
|
||||
.21875 -.21875
|
||||
0.21875 -0.21875
|
||||
|
||||
; print round(a,3,0), round(a,3,1), round(a,3,2), print round(a,3,3)
|
||||
.218, .219, .218, .219
|
||||
0.218, 0.219, 0.218, 0.219
|
||||
|
||||
; print round(b,3,0), round(b,3,1), round(b,3,2), print round(b,3,3)
|
||||
-.219, -.218, -.218, -.219
|
||||
-0.219, -0.218, -0.218, -0.219
|
||||
|
||||
; print round(a,3,16), round(a,3,17), round(a,3,18), print round(a,3,19)
|
||||
.2188 .2188 .2188 .2188
|
||||
0.2188 0.2188 0.2188 0.2188
|
||||
|
||||
; print round(a,4,16), round(a,4,17), round(a,4,18), print round(a,4,19)
|
||||
.2187 .2188 .2187 .2188
|
||||
0.2187 0.2188 0.2187 0.2188
|
||||
|
||||
; print round(a,2,8), round(a,3,8), round(a,4,8), round(a,5,8)
|
||||
.22 .218 .2188 .21875
|
||||
0.22 0.218 0.2188 0.21875
|
||||
|
||||
; print round(a,2,24), round(a,3,24), round(a,4,24), round(a,5,24)
|
||||
.22 .219 .2188 .21875
|
||||
0.22 0.219 0.2188 0.21875
|
||||
|
||||
; c = 21875
|
||||
; print round(c,-2,0), round(c,-2,1), round(c,-3,0), round(c,-3,16)
|
||||
@@ -100,13 +100,13 @@ EXAMPLES
|
||||
; print round(A,2,24)
|
||||
|
||||
list(7 elements, 7 nonzero):
|
||||
[[0]] = .12
|
||||
[[1]] = .25
|
||||
[[3]] = .38
|
||||
[[4]] = .5
|
||||
[[5]] = .62
|
||||
[[6]] = .75
|
||||
[[7]] = .88
|
||||
[[0]] = 0.12
|
||||
[[1]] = 0.25
|
||||
[[3]] = 0.38
|
||||
[[4]] = 0.5
|
||||
[[5]] = 0.62
|
||||
[[6]] = 0.75
|
||||
[[7]] = 0.88
|
||||
|
||||
LIMITS
|
||||
For non-object case:
|
||||
@@ -122,7 +122,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
round, trunc, btrunc, int, appr
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -23,7 +23,10 @@ DESCRIPTION
|
||||
depths.
|
||||
|
||||
EXAMPLE
|
||||
n/a
|
||||
; ## NOTE: Your current calculation level may vary:
|
||||
|
||||
; calclevel()
|
||||
0
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -34,7 +37,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
eval, read, quit, abort, inputlevel
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,7 +18,10 @@ DESCRIPTION
|
||||
information on CALCPATH.
|
||||
|
||||
EXAMPLE
|
||||
n/a
|
||||
; ## NOTE: Your current CALCPATH search path may vary:
|
||||
|
||||
; calcpath()
|
||||
".:./cal:~/.cal:/usr/local/share/calc:/usr/local/share/calc/custom"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -29,7 +32,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
environment, fpathopen
|
||||
|
||||
## Copyright (C) 2006 Landon Curt Noll
|
||||
## Copyright (C) 2006,2021 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
|
||||
|
@@ -13,11 +13,12 @@ DESCRIPTION
|
||||
this function will return an empty string.
|
||||
|
||||
EXAMPLE
|
||||
% calc "print cmdbuf(); a = 3; print a^2;"
|
||||
# NOTE: The following is intended to a shell command line:
|
||||
|
||||
$ calc "print cmdbuf(); a = 3; print a^2;"
|
||||
print cmdbuf(); a = 3; print a^2;
|
||||
|
||||
9
|
||||
%
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -28,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
argv, system
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
17
help/config
17
help/config
@@ -45,7 +45,7 @@ DESCRIPTION
|
||||
"round" sets rounding mode for round and bround
|
||||
"outround" sets rounding mode for printing of numbers
|
||||
"leadzero" enables/disables printing of 0 as in 0.5
|
||||
"fullzero" enables/disables padding zeros as in .5000
|
||||
"fullzero" enables/disables padding zeros as in 0.5000
|
||||
"maxscan" maximum number of scan errors before abort
|
||||
"prompt" default interactive prompt
|
||||
"more" default interactive multi-line input prompt
|
||||
@@ -883,7 +883,6 @@ DESCRIPTION
|
||||
|
||||
This config parameter is read-only and cannot be set.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; current_cfg = config("all");
|
||||
; config("tilde", off),;
|
||||
@@ -962,7 +961,8 @@ EXAMPLE
|
||||
*/
|
||||
; config("tilde", 1),;
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; config("display", 12),; /* or display(12),; */
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -970,7 +970,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; config("display", 12),; /* or display(12),; */
|
||||
; printf("%f\n", pi(1e-72));
|
||||
~3.141592653590
|
||||
@@ -978,7 +979,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; config("display", 72),; /* or display(72),; */
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -986,7 +988,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; config("display", 72),; /* or display(72),; */
|
||||
; printf("%f\n", pi(1e-72));
|
||||
3.141592653589793238462643383279502884197169399375105820974944592307816406
|
||||
@@ -998,7 +1001,7 @@ LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
n/a
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
custom, custom_cal, display, epsilon, fprintf, printf, strprintf, usage
|
||||
|
6
help/cos
6
help/cos
@@ -16,14 +16,14 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print cos(1, 1e-5), cos(1, 1e-10), cos(1, 1e-15), cos(1, 1e-20)
|
||||
.5403 .5403023059 .54030230586814 .5403023058681397174
|
||||
0.5403 0.5403023059 0.54030230586814 0.5403023058681397174
|
||||
|
||||
; print cos(2 + 3i, 1e-5), cos(2 + 3i, 1e-10)
|
||||
-4.18963-9.10923i -4.189625691-9.1092278938i
|
||||
|
||||
; pi = pi(1e-20)
|
||||
; print cos(pi/3, 1e-10), cos(pi/2, 1e-10), cos(pi, 1e-10)
|
||||
.5 0 -1
|
||||
0.5 0 -1
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -35,7 +35,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
sin, tan, sec, csc, cot, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
4
help/cot
4
help/cot
@@ -16,7 +16,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print cot(1, 1e-5), cot(1, 1e-10), cot(1, 1e-15), cot(1, 1e-20)
|
||||
.64209 .6420926159 .642092615934331 .64209261593433070301
|
||||
0.64209 0.6420926159 0.642092615934331 0.64209261593433070301
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -27,7 +27,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
sin, cos, tan, sec, csc, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print csch(1, 1e-5), csch(1, 1e-10), csch(1, 1e-15), csch(1, 1e-20)
|
||||
.85092 .8509181282 .850918128239322 .85091812823932154513
|
||||
0.85092 0.8509181282 0.850918128239322 0.85091812823932154513
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -29,7 +29,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
sinh, cosh, tanh, sech, coth, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -16,6 +16,8 @@ DESCRIPTION
|
||||
The 25th ctime() character, '\n' is removed.
|
||||
|
||||
EXAMPLE
|
||||
; ## NOTE: Your output will likely vary:
|
||||
|
||||
; printf("The time is now %s.\n", ctime())
|
||||
The time is now Mon Apr 15 12:41:44 1996.
|
||||
|
||||
@@ -28,7 +30,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
runtime, time
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1996,1999,2021 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
|
||||
|
@@ -54,9 +54,8 @@ DESCRIPTION
|
||||
|
||||
return_value == d + m/60;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global d, m;
|
||||
|
||||
@@ -74,7 +73,7 @@ EXAMPLE
|
||||
; print d2dm(360.321,deg=,min=), deg, min;
|
||||
0.321 0 19.26
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print d2dm(654.321,deg=,min=,1), deg, min;
|
||||
-65.679 -65 -40.74
|
||||
@@ -83,7 +82,6 @@ EXAMPLE
|
||||
; print d2dm(360.321,deg=,min=,1), deg, min;
|
||||
-359.679 -359 -40.74
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -69,9 +69,8 @@ DESCRIPTION
|
||||
|
||||
return_value == d + m/60 + s/3600;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global d, m, s;
|
||||
|
||||
@@ -89,7 +88,7 @@ EXAMPLE
|
||||
; print d2dms(360.321,deg=,min=,sec=), deg, min, sec;
|
||||
0.321 0 19 15.6
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print d2dms(654.321,deg=,min=,sec=,1), deg, min, sec;
|
||||
-65.679 -65 -40 -44.4
|
||||
@@ -98,7 +97,6 @@ EXAMPLE
|
||||
; print d2dms(360.321,deg=,min=,sec=,1), deg, min, sec;
|
||||
-359.679 -359 -40 -44.4
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
14
help/det
14
help/det
@@ -58,11 +58,13 @@ EXAMPLE
|
||||
; print det(A)
|
||||
obj res {5}
|
||||
|
||||
Note that if A had been a 3 x 3 or larger matrix, res_div(a,b) for
|
||||
non-zero b would have had to be defined (assuming at least one
|
||||
division is necessary); for consistent results when md is composite,
|
||||
res_div(a,b) should be defined only when b and md are relatively
|
||||
prime; there is no problem when md is prime.
|
||||
; /*
|
||||
* NOTE: if A had been a 3 x 3 or larger matrix, res_div(a,b) for
|
||||
* non-zero b would have had to be defined (assuming at least one
|
||||
* division is necessary); for consistent results when md is composite,
|
||||
* res_div(a,b) should be defined only when b and md are relatively
|
||||
* prime; there is no problem when md is prime.
|
||||
*/
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -73,7 +75,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
matdim, matmax, matmin, inverse
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -61,7 +61,6 @@ DESCRIPTION
|
||||
|
||||
if r and q satisfy n = q * b + r.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; a = 123456.789
|
||||
; for (n = 6; n >= -6; n++) print digit(a, n),; print
|
||||
|
12
help/display
12
help/display
@@ -55,7 +55,8 @@ EXAMPLE
|
||||
*/
|
||||
; config("tilde", 1),;
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -63,7 +64,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
~3.141592653590
|
||||
@@ -71,7 +73,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -79,7 +82,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
3.141592653589793238462643383279502884197169399375105820974944592307816406
|
||||
|
@@ -29,7 +29,6 @@ DESCRIPTION
|
||||
|
||||
The dm2d(d, m, rnd) builtin is an alias for dms2d(d, m, 0, rnd).
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print dm2d(203, 325.5594);
|
||||
208.42599
|
||||
@@ -50,7 +49,6 @@ EXAMPLE
|
||||
; print dms2d(12, 20, 44.16, 1);
|
||||
-347.6544
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
16
help/epsilon
16
help/epsilon
@@ -23,7 +23,7 @@ EXAMPLE
|
||||
; epsilon(1e-20),;
|
||||
; oldeps = epsilon(1e-6)
|
||||
; print epsilon(), sqrt(2), epsilon(1e-4), sqrt(2), epsilon(oldeps)
|
||||
; .000001 1.414214 .000001 1.4142 .0001
|
||||
; 0.000001 1.414214 0.000001 1.4142 0.0001
|
||||
|
||||
; /*
|
||||
* NOTE: When displaying many digits after the decimal point
|
||||
@@ -35,7 +35,8 @@ EXAMPLE
|
||||
*/
|
||||
; config("tilde", 1),;
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -43,7 +44,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
~3.141592653590
|
||||
@@ -51,7 +53,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -59,7 +62,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
3.141592653589793238462643383279502884197169399375105820974944592307816406
|
||||
@@ -77,7 +81,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
config, display, fprintf, printf, strprintf
|
||||
|
||||
## Copyright (C) 1999,2018 Landon Curt Noll
|
||||
## Copyright (C) 1999,2018,2021 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
|
||||
|
@@ -28,6 +28,8 @@ DESCRIPTION
|
||||
errcount.
|
||||
|
||||
EXAMPLE
|
||||
; ## NOTE: Your output may vary:
|
||||
|
||||
; errmax(10)
|
||||
0
|
||||
; errcount()
|
||||
@@ -46,7 +48,7 @@ SEE ALSO
|
||||
errmax, error, strerror, iserror, errno, newerror, errorcodes,
|
||||
stoponerror
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -26,8 +26,8 @@ EXAMPLE
|
||||
; a = 1/0; b = 2 + ""; c = error(27); d = newerror("alpha");
|
||||
Error 27 caused errcount to exceed errmax
|
||||
|
||||
## Here global variables c and d were created when compiling the line
|
||||
## but execution was aborted before the intended assignments to c and d.
|
||||
; ## Here global variables c and d were created when compiling the line
|
||||
; ## but execution was aborted before the intended assignments to c and d.
|
||||
|
||||
; print c, d
|
||||
0 0
|
||||
@@ -45,7 +45,7 @@ SEE ALSO
|
||||
errcount, error, strerror, iserror, errno, newerror, errorcodes,
|
||||
stoponerror
|
||||
|
||||
## Copyright (C) 2006 Landon Curt Noll
|
||||
## Copyright (C) 2006,2021 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
|
||||
|
@@ -32,7 +32,8 @@ DESCRIPTION
|
||||
"No error".
|
||||
|
||||
EXAMPLE
|
||||
Assuming there is no file with name "not_a_file"
|
||||
; ## Assuming there is no file with name "not_a_file"
|
||||
|
||||
; errno(0)
|
||||
0
|
||||
; errmax(errcount()+4)
|
||||
@@ -55,7 +56,7 @@ SEE ALSO
|
||||
errmax, errcount, error, strerror, iserror, newerror, errorcodes,
|
||||
stoponerror
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -24,7 +24,6 @@ DESCRIPTION
|
||||
|
||||
For real x, estr(x) represents x in fractional mode.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; estr("abc\0xyz\00023\n\xa5\r\n")
|
||||
""abc\0xyz\00023\n\xa5\r\n""
|
||||
|
4
help/exp
4
help/exp
@@ -25,7 +25,7 @@ EXAMPLE
|
||||
10686474600000 10686474581524 10686474581524.4621469905
|
||||
|
||||
; print exp(-20, 1e-5), exp(-20, 1e-10), exp(-20, 1e-15), exp(-20, 1e-20)
|
||||
0 .0000000021 .000000002061154 .00000000206115362244
|
||||
0 0.0000000021 0.000000002061154 0.00000000206115362244
|
||||
|
||||
; print exp(1+2i, 1e-5), exp(1+2i, 1e-10)
|
||||
-1.1312+2.47173i -1.1312043838+2.471726672i
|
||||
@@ -40,7 +40,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
ln, cosh, sinh, tanh
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -21,7 +21,6 @@ DESCRIPTION
|
||||
the file position will be that immediately after that character.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
; f = fopen("/tmp/junk", "w")
|
||||
; fputs(f, " Alpha Beta \n")
|
||||
; freopen(f, "r")
|
||||
|
@@ -27,9 +27,7 @@ DESCRIPTION
|
||||
|
||||
read newfile;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
|
||||
; f = fopen("/tmp/newfile", "w")
|
||||
; fputs(f, "abc\0xyz\n\t\xb0\0\r\v123"
|
||||
; freopen(f, "r")
|
||||
@@ -45,7 +43,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
fgets, fgetstr, files, fopen, fprintf, fputs, fputstr
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
16
help/fprintf
16
help/fprintf
@@ -35,7 +35,7 @@ EXAMPLE
|
||||
|
||||
mat [4] (4 elements, 4 nonzero):
|
||||
[0] = 1.4142135623730950488
|
||||
[1] = ~.42857142857142857142
|
||||
[1] = ~0.42857142857142857142
|
||||
[2] = "undefined"
|
||||
[3] = NULL
|
||||
|
||||
@@ -55,7 +55,8 @@ EXAMPLE
|
||||
*/
|
||||
; config("tilde", 1),;
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; display(12),;
|
||||
; fprintf(files(1), "%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -63,7 +64,8 @@ EXAMPLE
|
||||
; fprintf(files(1), "%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; display(12),;
|
||||
; fprintf(files(1), "%f\n", pi(1e-72));
|
||||
~3.141592653590
|
||||
@@ -71,7 +73,8 @@ EXAMPLE
|
||||
; fprintf(files(1), "%f\n", pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; display(72),;
|
||||
; fprintf(files(1), "%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -79,7 +82,8 @@ EXAMPLE
|
||||
; fprintf(files(1), "%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; display(72),;
|
||||
; fprintf(files(1), "%f\n", pi(1e-72));
|
||||
3.141592653589793238462643383279502884197169399375105820974944592307816406
|
||||
@@ -96,7 +100,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
config, display, epsilon, printf, strprintf
|
||||
|
||||
## Copyright (C) 1999-2006,2018 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2018,2021 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
|
||||
|
@@ -21,7 +21,6 @@ DESCRIPTION
|
||||
fs. A non-null value is returned only if the attempt fails.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
; f = fopen("/tmp/junk", "w")
|
||||
; fputs(f, "Leonard Euler")
|
||||
; freopen(f, "r")
|
||||
|
@@ -54,9 +54,8 @@ DESCRIPTION
|
||||
|
||||
return_value == g + m/60;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global g, m;
|
||||
|
||||
@@ -74,7 +73,7 @@ EXAMPLE
|
||||
; print g2gm(400.321,grad=,min=), grad, min;
|
||||
0.321 0 19.26
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print g2gm(654.321,grad=,min=,1), grad, min;
|
||||
-145.679 -145 -40.74
|
||||
@@ -83,7 +82,6 @@ EXAMPLE
|
||||
; print g2gm(400.321,grad=,min=,1), grad, min;
|
||||
-399.679 -399 -40.74
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -69,9 +69,8 @@ DESCRIPTION
|
||||
|
||||
return_value == g + m/60 + s/3600;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global g, m, s;
|
||||
|
||||
@@ -89,7 +88,7 @@ EXAMPLE
|
||||
; print g2gms(400.321,grad=,min=,sec=), grad, min, sec;
|
||||
0.321 0 19 15.6
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print g2gms(654.321,grad=,min=,sec=,1), grad, min, sec;
|
||||
-145.679 -145 -40 -44.4
|
||||
@@ -98,7 +97,6 @@ EXAMPLE
|
||||
; print g2gms(400.321,grad=,min=,sec=,1), grad, min, sec;
|
||||
-399.679 -399 -40 -44.4
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
4
help/gcd
4
help/gcd
@@ -16,7 +16,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print gcd(12, -24, 30), gcd(9/10, 11/5, 4/25), gcd(0,0,0,0,0)
|
||||
6 .02 0
|
||||
6 0.02 0
|
||||
|
||||
LIMITS
|
||||
The number of arguments may not to exceed 1024.
|
||||
@@ -27,7 +27,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
lcm
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
4
help/gd
4
help/gd
@@ -36,10 +36,10 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print gd(1, 1e-5), gd(1, 1e-10), gd(1, 1e-15)
|
||||
.86577 .8657694832 .865769483239659
|
||||
0.86577 0.8657694832 0.865769483239659
|
||||
|
||||
; print gd(2+1i, 1e-5), gd(2+1i, 1e-10)
|
||||
1.42291+.22751i 1.4229114625+.2275106584i
|
||||
1.42291+0.22751i 1.4229114625+0.2275106584i
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
@@ -29,7 +29,6 @@ DESCRIPTION
|
||||
|
||||
The gm2g(d, m, rnd) builtin is an alias for gms2g(d, m, 0, rnd).
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print gm2g(203, 325.5594);
|
||||
208.42599
|
||||
@@ -50,7 +49,6 @@ EXAMPLE
|
||||
; print gms2g(12, 20, 44.16, 1);
|
||||
-387.6544
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -54,9 +54,8 @@ DESCRIPTION
|
||||
|
||||
return_value == h + m/60;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global h, m;
|
||||
|
||||
@@ -74,7 +73,7 @@ EXAMPLE
|
||||
; print h2hm(24.321,hour=,min=), hour, min;
|
||||
0.321 0 19.26
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print h2hm(654.321,hour=,min=,1), hour, min;
|
||||
-17.679 -17 -40.74
|
||||
@@ -83,7 +82,6 @@ EXAMPLE
|
||||
; print h2hm(24.321,hour=,min=,1), hour, min;
|
||||
-23.679 -23 -40.7
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -69,9 +69,8 @@ DESCRIPTION
|
||||
|
||||
return_value == h + m/60 + s/3600;
|
||||
|
||||
|
||||
EXAMPLE
|
||||
/* if args are undefined, pre-declare them or assign them as args */
|
||||
; ## if args are undefined, pre-declare them or assign them as args
|
||||
|
||||
; global h, m, s;
|
||||
|
||||
@@ -89,7 +88,7 @@ EXAMPLE
|
||||
; print h2hms(24.321,hour=,min=,sec=), hour, min, sec;
|
||||
0.321 0 19 15.6
|
||||
|
||||
/* certain non-default rounding modes can return negative values */
|
||||
; ## certain non-default rounding modes can return negative values
|
||||
|
||||
; print h2hms(654.321,hour=,min=,sec=,1), hour, min, sec;
|
||||
-17.679 -17 -40 -44.4
|
||||
@@ -98,7 +97,6 @@ EXAMPLE
|
||||
; print h2hms(24.321,hour=,min=,sec=,1), hour, min, sec;
|
||||
-23.679 -23 -40 -44.4
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -29,7 +29,6 @@ DESCRIPTION
|
||||
|
||||
The hm2h(h, m, rnd) builtin is an alias for hms2h(h, m, 0, rnd).
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print hm2h(203, 325.5594);
|
||||
16.42599
|
||||
@@ -50,7 +49,6 @@ EXAMPLE
|
||||
; print hms2h(12, 20, 44.16, 1);
|
||||
-11.6544
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
|
@@ -24,7 +24,10 @@ DESCRIPTION
|
||||
of inputlevel() indicate reading at greater depths.
|
||||
|
||||
EXAMPLE
|
||||
n/a
|
||||
; ## NOTE: Your current input level may vary:
|
||||
|
||||
; inputlevel()
|
||||
0
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
@@ -25,7 +25,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print inverse(5/4), inverse(-2/7), inverse(3 + 4i)
|
||||
.8 -3.5 .12-.16i
|
||||
0.8 -3.5 0.12-0.16i
|
||||
|
||||
; mat A[2,2] = {2,3,5,7}
|
||||
; print inverse(A)
|
||||
@@ -47,7 +47,7 @@ LINK LIBRARY
|
||||
|
||||
SEE ALSO
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
4
help/ln
4
help/ln
@@ -21,7 +21,7 @@ EXAMPLE
|
||||
2.30259 2.302585093 2.302585092994046 2.30258509299404568402
|
||||
|
||||
; print ln(2+3i, 1e-5), ln(2+3i, 1e-10)
|
||||
1.28247+.98279i 1.2824746787+.9827937232i
|
||||
1.28247+0.98279i 1.2824746787+0.9827937232i
|
||||
|
||||
LIMITS
|
||||
x != 0
|
||||
@@ -34,7 +34,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
exp, acosh, asinh, atanh, log
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -17,7 +17,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print ltol(0.4, 1e-6), hypot(0.5, 1e-6)
|
||||
.6 .866025
|
||||
0.6 0.866025
|
||||
|
||||
LIMITS
|
||||
abs(x) <= 1
|
||||
@@ -28,7 +28,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
hypot
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
2
help/mat
2
help/mat
@@ -407,7 +407,7 @@ LIMITS
|
||||
times as long to invert a 100 * 100 matrix.
|
||||
|
||||
LINK LIBRARY
|
||||
n/a
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
ismat, matdim, matmax, matmin, mattrans, mattrace, matsum, matfill,
|
||||
|
@@ -49,7 +49,7 @@ DESCRIPTION
|
||||
|
||||
The minimum value for memsize(x) occurs for the null and error values.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
|
||||
The results for examples like these will depend to some extent on
|
||||
the system being used. The following were for an SGI R4k machine
|
||||
|
@@ -113,7 +113,7 @@ operators
|
||||
as division of real numbers, and think of '//' as division
|
||||
of integers (e.g., 8 / 3 is 8/3 whereas 8 // 3 is 2).
|
||||
The '%' is integral or fractional modulus (e.g., 11%4 is 3,
|
||||
and 10%pi() is ~.575222).
|
||||
and 10%pi() is ~0.575222).
|
||||
|
||||
| Bitwise OR.
|
||||
In a | b, both a and b are to be real integers;
|
||||
@@ -128,7 +128,7 @@ operators
|
||||
^ ** << >>
|
||||
Powers and shifts.
|
||||
The '^' and '**' are both exponentiation, e.g. 2^3
|
||||
returns 8, 2^-3 returns .125. Note that in a^b, if
|
||||
returns 8, 2^-3 returns 0.125. Note that in a^b, if
|
||||
'a' == 0 and 'b' is real, then is must be >= 0 as well.
|
||||
Also 0^0 and 0**0 return the value 1.
|
||||
|
||||
|
@@ -19,7 +19,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print polar(2, 0), polar(1, 2, 1e-5), polar(1, 2, 1e-10)
|
||||
2 -.41615+.9093i -.4161468365+.9092974268i
|
||||
2 -0.41615+0.9093i -0.4161468365+0.9092974268i
|
||||
|
||||
; pi = pi(1e-10); eps = 1e-5
|
||||
; print polar(2, pi/4, eps), polar(2, pi/2, eps), polar(2, 3*pi/4, eps)
|
||||
@@ -34,7 +34,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
abs, arg, re, im
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -35,7 +35,7 @@ EXAMPLE
|
||||
2.71828182845904523536
|
||||
|
||||
; print power(1i, 1i, 1e-20)
|
||||
.20787957635076190855
|
||||
0.20787957635076190855
|
||||
|
||||
; print power(exp(1, 1e-20), pi(1e-20) * 1i/2, 1e-20)
|
||||
1i
|
||||
@@ -55,7 +55,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
root
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
23
help/printf
23
help/printf
@@ -165,7 +165,6 @@ DESCRIPTION
|
||||
|
||||
; fclose(fd);
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; config("epsilon", 1e-6),;
|
||||
: config("display", 6),;
|
||||
@@ -179,11 +178,15 @@ EXAMPLE
|
||||
|
||||
; fd = fopen("/tmp/test.txt", "w+");
|
||||
; fprintf(fd, "%d\n", 2^23209-1);
|
||||
; /* one must flush to be buffered output is written */
|
||||
|
||||
; ## one must flush to be buffered output is written
|
||||
|
||||
; fflush(fd);
|
||||
; display(10000),;
|
||||
; fprintf(fd, "%d\n", pi(1e-10000));
|
||||
; /* closing the file will also flush the buffer */
|
||||
|
||||
; ## closing the file will also flush the buffer
|
||||
|
||||
; fclose(fd);
|
||||
|
||||
; printf("%x\n", 1.2345);
|
||||
@@ -207,7 +210,7 @@ EXAMPLE
|
||||
; printf("%f%r",A,A);
|
||||
mat [4] (4 elements, 4 nonzero):
|
||||
[0] = 1.414214
|
||||
[1] = .428571
|
||||
[1] = 0.428571
|
||||
[2] = "undefined"
|
||||
[3] = NULL
|
||||
|
||||
@@ -262,7 +265,8 @@ EXAMPLE
|
||||
*/
|
||||
; config("tilde", 1),;
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -270,7 +274,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; display(12),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
~3.141592653590
|
||||
@@ -278,7 +283,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-10));
|
||||
3.1415926536
|
||||
@@ -286,7 +292,8 @@ EXAMPLE
|
||||
; printf("%f\n", pi());
|
||||
3.1415926536
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; display(72),;
|
||||
; printf("%f\n", pi(1e-72));
|
||||
3.141592653589793238462643383279502884197169399375105820974944592307816406
|
||||
|
@@ -200,7 +200,6 @@ DESCRIPTION
|
||||
only when it is referred to by A.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
; A = 27
|
||||
; protect(A,1)
|
||||
; A = 45
|
||||
|
@@ -108,7 +108,7 @@ EXAMPLE
|
||||
The integer x in this example is the smallest positive integer that is
|
||||
a strong pseudoprime to each of the first four primes 2, 3, 5, 7, but
|
||||
not to base 11. The probability that ptest(x,-1,0) will return 1 is
|
||||
about .23.
|
||||
about 0.23.
|
||||
|
||||
; for (i = 0; i < 11; i++) print ptest(91,-1,0),:; print;
|
||||
0 0 0 1 0 0 0 0 0 0 1
|
||||
|
@@ -25,7 +25,6 @@ DESCRIPTION
|
||||
|
||||
putenv(strcat(env, "=", val))
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; putenv("name", "value")
|
||||
0
|
||||
@@ -47,7 +46,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
getenv
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -68,7 +68,6 @@ DESCRIPTION
|
||||
argument is not as specified above, or if Q or R has no-assign-to
|
||||
protection, e.g. after protect(Q,1).
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; global u, v;
|
||||
; global mat M[2];
|
||||
|
@@ -137,7 +137,6 @@ DESCRIPTION
|
||||
of the other compiled in Blum moduli or provide your own. See
|
||||
the srandom help page for details.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print srandom(0), random(), random(), random()
|
||||
RANDOM state 9203168135432720454 13391974640168007611 13954330032848846793
|
||||
|
@@ -32,13 +32,13 @@ EXAMPLE
|
||||
1.62658 1.6265765617 1.626576561697786
|
||||
|
||||
; print root(1+3i, 3, 1e-5), root(1 + 3i, 3, 1e-10)
|
||||
1.34241+.59361i 1.3424077452+.5936127825i
|
||||
1.34241+0.59361i 1.3424077452+0.5936127825i
|
||||
|
||||
; print root(-8, 3, 1e-5), root(-8, 34, 1e-5)
|
||||
-2 ~1.05853505050032399594+~.09807874962631613016i
|
||||
-2 ~1.05853505050032399594+~0.09807874962631613016i
|
||||
|
||||
; print root(1i, 100, 1e-20)
|
||||
.99987663248166059864+.01570731731182067575i
|
||||
0.99987663248166059864+0.01570731731182067575i
|
||||
|
||||
LIMITS
|
||||
n >= 0
|
||||
@@ -52,7 +52,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
power
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
32
help/round
32
help/round
@@ -65,29 +65,29 @@ DESCRIPTION
|
||||
changed by assignments; plcs and rnd are copied to temporary
|
||||
variables, so their values are not changed by the call.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
; a = 7/32, b = -7/32
|
||||
|
||||
; print a, b
|
||||
.21875 -.21875
|
||||
0.21875 -0.21875
|
||||
|
||||
; print round(a,3,0), round(a,3,1), round(a,3,2), print round(a,3,3)
|
||||
.218, .219, .218, .219
|
||||
0.218, 0.219, 0.218, 0.219
|
||||
|
||||
; print round(b,3,0), round(b,3,1), round(b,3,2), print round(b,3,3)
|
||||
-.219, -.218, -.218, -.219
|
||||
-0.219, -0.218, -0.218, -0.219
|
||||
|
||||
; print round(a,3,16), round(a,3,17), round(a,3,18), print round(a,3,19)
|
||||
.2188 .2188 .2188 .2188
|
||||
0.2188 0.2188 0.2188 0.2188
|
||||
|
||||
; print round(a,4,16), round(a,4,17), round(a,4,18), print round(a,4,19)
|
||||
.2187 .2188 .2187 .2188
|
||||
0.2187 0.2188 0.2187 0.2188
|
||||
|
||||
; print round(a,2,8), round(a,3,8), round(a,4,8), round(a,5,8)
|
||||
.22 .218 .2188 .21875
|
||||
0.22 0.218 0.2188 0.21875
|
||||
|
||||
; print round(a,2,24), round(a,3,24), round(a,4,24), round(a,5,24)
|
||||
.22 .219 .2188 .21875
|
||||
0.22 0.219 0.2188 0.21875
|
||||
|
||||
; c = 21875
|
||||
; print round(c,-2,0), round(c,-2,1), round(c,-3,0), round(c,-3,16)
|
||||
@@ -100,13 +100,13 @@ EXAMPLES
|
||||
; print round(A,2,24)
|
||||
|
||||
list(7 elements, 7 nonzero):
|
||||
[[0]] = .12
|
||||
[[1]] = .25
|
||||
[[3]] = .38
|
||||
[[4]] = .5
|
||||
[[5]] = .62
|
||||
[[6]] = .75
|
||||
[[7]] = .88
|
||||
[[0]] = 0.12
|
||||
[[1]] = 0.25
|
||||
[[3]] = 0.38
|
||||
[[4]] = 0.5
|
||||
[[5]] = 0.62
|
||||
[[6]] = 0.75
|
||||
[[7]] = 0.88
|
||||
|
||||
LIMITS
|
||||
For non-object case:
|
||||
@@ -122,7 +122,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
bround, btrunc, trunc, int, appr
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -24,7 +24,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print scale(3, 2), scale(3,1), scale(3,0), scale(3,-1), scale(3,-2)
|
||||
12 6 3 1.5 .75
|
||||
12 6 3 1.5 0.75
|
||||
|
||||
LIMITS
|
||||
For non-object x, abs(n) < 2^31
|
||||
@@ -37,7 +37,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
obj
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print sech(1, 1e-5), sech(1, 1e-10), sech(1, 1e-15), sech(1, 1e-20)
|
||||
.64805 .6480542737 .648054273663885 .64805427366388539958
|
||||
0.64805 0.6480542737 0.648054273663885 0.64805427366388539958
|
||||
|
||||
LIMITS
|
||||
unlike sin and cos, x must be real
|
||||
@@ -30,7 +30,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
sinh, cosh, tanh, csch, coth, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
3
help/sgn
3
help/sgn
@@ -22,7 +22,6 @@ DESCRIPTION
|
||||
|
||||
sgn(re(x)) + sgn(im(x))*1i
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; print sgn(27), sgn(1e-20), sgn(0), sgn(-45)
|
||||
1 1 0 -1
|
||||
@@ -39,7 +38,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
abs
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
6
help/sin
6
help/sin
@@ -16,14 +16,14 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print sin(1, 1e-5), sin(1, 1e-10), sin(1, 1e-15), sin(1, 1e-20)
|
||||
.84147 .8414709848 .841470984807896 .84147098480789650665
|
||||
0.84147 0.8414709848 0.841470984807896 0.84147098480789650665
|
||||
|
||||
; print sin(2 + 3i, 1e-5), sin(2 + 3i, 1e-10)
|
||||
9.1545-4.16891i 9.1544991469-4.16890696i
|
||||
|
||||
; pi = pi(1e-20)
|
||||
; print sin(pi/6, 1e-10), sin(pi/2, 1e-10), sin(pi, 1e-10)
|
||||
.5 1 0
|
||||
0.5 1 0
|
||||
|
||||
LIMITS
|
||||
eps > 0
|
||||
@@ -35,7 +35,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
cos, tan, sec, csc, cot, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -51,7 +51,7 @@ DESCRIPTION
|
||||
|
||||
The minimum value for sizeof(x) occurs for the null and error values.
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
The results for examples like these will depend to some extent on
|
||||
the system being used. The following were for an SGI R4k machine
|
||||
in 32-bit mode:
|
||||
|
@@ -206,7 +206,7 @@ DESCRIPTION
|
||||
|
||||
1 The order of the elements is reversed
|
||||
|
||||
EXAMPLES
|
||||
EXAMPLE
|
||||
; A = list(1, 7, 2, 4, 2)
|
||||
; print sort(A)
|
||||
|
||||
|
@@ -103,7 +103,6 @@ DESCRIPTION
|
||||
decimal digit being even when the part differs from a multiple
|
||||
of 1e-20 by 1/2 * 1e-20.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; eps = 1e-4
|
||||
; print sqrt(4,eps,0), sqrt(4,eps,64), sqrt(8i,eps,0), sqrt(8i, eps, 64)
|
||||
@@ -117,7 +116,7 @@ EXAMPLE
|
||||
1.2346 1.2345678 -1.2345678
|
||||
|
||||
; print sqrt(.00005^2, eps, 24), sqrt(.00015^2, eps, 24)
|
||||
0 .0002
|
||||
0 0.0002
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
@@ -21,7 +21,6 @@ DESCRIPTION
|
||||
in this case, the size of the resulting string is the sum of the
|
||||
sizes of the component strings.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; A = "abc"; B = "XY"; C = " ";
|
||||
; print strcat(A, B, C, B, A)
|
||||
@@ -37,7 +36,7 @@ SEE ALSO
|
||||
strcmp, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2021 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
|
||||
|
@@ -22,7 +22,6 @@ DESCRIPTION
|
||||
both greater than equal to n, 0 is returned.
|
||||
This function is case independent.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
strncasecmp("abc", "xyz", 0) == 0
|
||||
strncasecmp("abc", "xyz", 1) == -1
|
||||
@@ -44,7 +43,7 @@ SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncpy, strpos, strcasecmp
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2013 Christoph Zurnieden
|
||||
## Copyright (C) 2013,2021 Christoph Zurnieden
|
||||
##
|
||||
## 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
|
||||
|
20
help/strncmp
20
help/strncmp
@@ -21,17 +21,15 @@ DESCRIPTION
|
||||
to, or less than min(n2, n); in particular, if n1 and n2 are
|
||||
both greater than equal to n, 0 is returned.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
strncmp("abc", "xyz", 0) == 0
|
||||
strncmp("abc", "xyz", 1) == -1
|
||||
strncmp("abc", "", 1) == 1
|
||||
strncmp("a", "b", 2) == -1
|
||||
strncmp("ab", "ac", 2) == -1
|
||||
strncmp("\0ac", "\0b", 2) == -1
|
||||
strncmp("ab", "abc", 2) == 0
|
||||
strncmp("abc", "abd", 2) == 0
|
||||
|
||||
; strncmp("abc", "xyz", 0) == 0
|
||||
; strncmp("abc", "xyz", 1) == -1
|
||||
; strncmp("abc", "", 1) == 1
|
||||
; strncmp("a", "b", 2) == -1
|
||||
; strncmp("ab", "ac", 2) == -1
|
||||
; strncmp("\0ac", "\0b", 2) == -1
|
||||
; strncmp("ab", "abc", 2) == 0
|
||||
; strncmp("abc", "abd", 2) == 0
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -44,7 +42,7 @@ SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 Ernest Bowen
|
||||
## Copyright (C) 2006,2021 Ernest Bowen
|
||||
##
|
||||
## 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
|
||||
|
14
help/strncpy
14
help/strncpy
@@ -21,13 +21,13 @@ DESCRIPTION
|
||||
new value.
|
||||
|
||||
EXAMPLE
|
||||
strncpy("abcdef", "xyz", 0) == "abcdef"
|
||||
strncpy("abcdef", "xyz", 1) == "xbcdef"
|
||||
strncpy("abcdef", "xyz", 2) == "xycdef"
|
||||
strncpy("abcdef", "xyz", 3) == "xyzdef"
|
||||
strncpy("abcdef", "xyz", 4) == "xyz\0ef"
|
||||
strncpy("abcdef", "xyz", 5) == "xyz\0\0f"
|
||||
strncpy("ab", "xyz", 3) == "xy"
|
||||
; strncpy("abcdef", "xyz", 0) == "abcdef"
|
||||
; strncpy("abcdef", "xyz", 1) == "xbcdef"
|
||||
; strncpy("abcdef", "xyz", 2) == "xycdef"
|
||||
; strncpy("abcdef", "xyz", 3) == "xyzdef"
|
||||
; strncpy("abcdef", "xyz", 4) == "xyz\0ef"
|
||||
; strncpy("abcdef", "xyz", 5) == "xyz\0\0f"
|
||||
; strncpy("ab", "xyz", 3) == "xy"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
@@ -48,7 +48,8 @@ EXAMPLE
|
||||
; config("tab", 0),;
|
||||
; fmt1 = "%f";
|
||||
|
||||
; /* NOTE: display has too few digits and epsilon is not small enough */
|
||||
; ## NOTE: display has too few digits and epsilon is not small enough
|
||||
|
||||
; display(12),;
|
||||
; strprintf(fmt1, pi(1e-10));
|
||||
"3.1415926536"
|
||||
@@ -56,7 +57,8 @@ EXAMPLE
|
||||
; strprintf(fmt1, pi());
|
||||
"3.1415926536"
|
||||
|
||||
; /* NOTE: display has too few digits yet epsilon is small enough */
|
||||
; ## NOTE: display has too few digits yet epsilon is small enough
|
||||
|
||||
; display(12),;
|
||||
; strprintf(fmt1, pi(1e-72));
|
||||
"~3.141592653590"
|
||||
@@ -64,7 +66,8 @@ EXAMPLE
|
||||
; strprintf(fmt1, pi());
|
||||
~3.141592653590
|
||||
|
||||
; /* NOTE: display has enough digits but epsilon is not small enough */
|
||||
; ## NOTE: display has enough digits but epsilon is not small enough
|
||||
|
||||
; display(72),;
|
||||
; strprintf(fmt1, pi(1e-10));
|
||||
"3.1415926536"
|
||||
@@ -72,7 +75,8 @@ EXAMPLE
|
||||
; strprintf(fmt1, pi());
|
||||
"3.1415926536"
|
||||
|
||||
/* NOTE: display has enough digits and epsilon is small enough */
|
||||
; ## NOTE: display has enough digits and epsilon is small enough
|
||||
|
||||
; display(72),;
|
||||
; strprintf(fmt1, pi(1e-72));
|
||||
"3.141592653589793238462643383279502884197169399375105820974944592307816406"
|
||||
@@ -91,7 +95,7 @@ SEE ALSO
|
||||
strlen, strncmp, strncpy, strpos, strscan, strscanf, substr,
|
||||
printf
|
||||
|
||||
## Copyright (C) 1999-2006,2018 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006,2018,2021 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
|
||||
|
@@ -19,7 +19,7 @@ DESCRIPTION
|
||||
The function returns the number of fields evaluated.
|
||||
|
||||
EXAMPLE
|
||||
global a,b
|
||||
; global a,b
|
||||
; strscan(" 2+3 a^2 print(b)", a, b, 0);
|
||||
25
|
||||
3
|
||||
@@ -36,7 +36,7 @@ SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscanf, substr
|
||||
|
||||
## Copyright (C) 1999-2006 Ernest Bowen
|
||||
## Copyright (C) 1999-2006,2021 Ernest Bowen
|
||||
##
|
||||
## 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
|
||||
|
@@ -91,7 +91,6 @@ DESCRIPTION
|
||||
is assigned to the corresponding lvalue. (Any width or skip specification
|
||||
is ignored.)
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; global a, b, c, d
|
||||
; A = "abc xyz 234.6 alpha"
|
||||
@@ -115,7 +114,7 @@ SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, substr
|
||||
|
||||
## Copyright (C) 1999-2006 Ernest Bowen
|
||||
## Copyright (C) 1999-2006,2021 Ernest Bowen
|
||||
##
|
||||
## 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
|
||||
|
@@ -24,7 +24,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; x = 3/4; y = "abc"; print x, y, swap(x,y), x, y
|
||||
.75 abc abc .75
|
||||
0.75 abc abc 0.75
|
||||
|
||||
; A = list(1,2,3); mat B[3] = {4,5,6}; swap(A[[1]], B[1]); print A[[1]], B[1]
|
||||
5 2
|
||||
@@ -38,7 +38,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
assign
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -19,13 +19,15 @@ DESCRIPTION
|
||||
POSIX system call and so this function will always return 0.
|
||||
|
||||
EXAMPLE
|
||||
; ## NOTE: Your output will likely vary:
|
||||
|
||||
The result for this example will depend on the speed of the CPU
|
||||
and precision of the operating CPU time accounting sub-system:
|
||||
|
||||
; t = systime();
|
||||
; system("true"),
|
||||
; systime() - t;
|
||||
.001
|
||||
0.001
|
||||
|
||||
LIMITS
|
||||
On non-POSIX based systems, this function always returns 0.
|
||||
@@ -36,7 +38,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
config, ctime, runtime, systime, time
|
||||
|
||||
## Copyright (C) 2006 Landon Curt Noll
|
||||
## Copyright (C) 2006,2021 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
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
; print tanh(1, 1e-5), tanh(1, 1e-10), tanh(1, 1e-15), tanh(1, 1e-20)
|
||||
.76159 .761594156 .761594155955765 .76159415595576488812
|
||||
0.76159 0.761594156 0.761594155955765 0.76159415595576488812
|
||||
|
||||
LIMITS
|
||||
unlike sin and cos, x must be real
|
||||
@@ -30,7 +30,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
sinh, cosh, sech, csch, coth, epsilon
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2021 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
|
||||
|
@@ -127,7 +127,7 @@ The calc web site is located at:
|
||||
|
||||
http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
||||
NOTE: The Email address uses 'asthe', while the web site uses 'isthe'.
|
||||
NOTE: The Email address uses 'asthe', while the web site uses 'isthe'.
|
||||
|
||||
## Copyright (C) 1999-2007,2014,2021 Landon Curt Noll
|
||||
##
|
||||
|
@@ -17,8 +17,8 @@ DESCRIPTION
|
||||
POSIX system call and so this function will always return 0.
|
||||
|
||||
EXAMPLE
|
||||
The result for this example will depend on the speed of the CPU
|
||||
and precision of the operating CPU time accounting sub-system:
|
||||
; ## The result for this example will depend on the speed of the CPU
|
||||
; ## and precision of the operating CPU time accounting sub-system:
|
||||
|
||||
; t = usertime();
|
||||
; x = ptest(2^4253-1);
|
||||
@@ -34,7 +34,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
config, ctime, usertime, systime, time
|
||||
|
||||
## Copyright (C) 2006 Landon Curt Noll
|
||||
## Copyright (C) 2006,2021 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
|
||||
|
@@ -20,8 +20,10 @@ DESCRIPTION
|
||||
t is the literal character 't'.
|
||||
|
||||
EXAMPLE
|
||||
; ## NOTE: Your version will likely vary:
|
||||
|
||||
; version()
|
||||
"2.11.5.4"
|
||||
"2.14.0.10"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -30,7 +32,7 @@ LINK LIBRARY
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
n/a
|
||||
calclevel, calcpath, inputlevel
|
||||
|
||||
## Copyright (C) 2001,2021 Landon Curt Noll
|
||||
##
|
||||
|
@@ -213,7 +213,7 @@ The calc web site is located at:
|
||||
|
||||
http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
||||
NOTE: The Email address uses 'asthe', while the web site uses 'isthe'.
|
||||
NOTE: The Email address uses 'asthe', while the web site uses 'isthe'.
|
||||
|
||||
## Copyright (C) 1999,2014,2021 Landon Curt Noll
|
||||
##
|
||||
|
Reference in New Issue
Block a user