mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.12.4.9
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Where to get the the latest versions of calc
|
||||
Where to get the latest versions of calc
|
||||
|
||||
Landon Noll maintains the official calc home page at:
|
||||
|
||||
@@ -31,8 +31,8 @@ chongo <was here> /\../\
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: archive,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: archive,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/archive,v $
|
||||
##
|
||||
## Under source code control: 1996/06/13 02:51:48
|
||||
|
@@ -86,7 +86,7 @@ DESCRIPTION
|
||||
; blkcpy(L, M);
|
||||
|
||||
For copying from a block B (named or unnamed), the total number of octets
|
||||
available for copying is taken to the the datalen for that block,
|
||||
available for copying is taken to the datalen for that block,
|
||||
so that num can be at most size(B) - ssi.
|
||||
|
||||
For copying to a block B (named or unnamed), reallocation will be
|
||||
@@ -206,8 +206,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: blkcpy,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: blkcpy,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkcpy,v $
|
||||
##
|
||||
## Under source code control: 1997/04/05 14:08:50
|
||||
|
@@ -50,9 +50,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: fgetc,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetc,v $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: fgetc,v 30.2 2013/03/27 06:08:56 root Exp $
|
||||
##
|
||||
## Under source code control: 1995/03/04 11:33:19
|
||||
## File existed as early as: 1995
|
||||
|
@@ -128,58 +128,72 @@ Using objects
|
||||
|
||||
The following is a list of the operations possible for objects.
|
||||
The 'xx' in each function name is replaced with the actual object
|
||||
type name. This table is displayed by the 'show objfuncs' command.
|
||||
type name. This table is displayed by the 'show objfunctions' command.
|
||||
|
||||
Name Args Comments
|
||||
|
||||
xx_print 1 print value, default prints elements
|
||||
xx_one 1 multiplicative identity, default is 1
|
||||
xx_test 1 logical test (false,true => 0,1),
|
||||
default tests elements
|
||||
xx_add 2
|
||||
xx_sub 2 subtraction, default adds negative
|
||||
xx_neg 1 negative
|
||||
xx_mul 2
|
||||
xx_div 2 non-integral division, default multiplies
|
||||
by inverse
|
||||
xx_inv 1 multiplicative inverse
|
||||
xx_abs 2 absolute value within given error
|
||||
xx_norm 1 square of absolute value
|
||||
xx_conj 1 conjugate
|
||||
xx_pow 2 integer power, default does multiply,
|
||||
square, inverse
|
||||
xx_sgn 1 sign of value (-1, 0, 1)
|
||||
xx_cmp 2 equality (equal,non-equal => 0,1),
|
||||
default tests elements
|
||||
xx_rel 2 inequality (less,equal,greater => -1,0,1)
|
||||
xx_quo 2 integer quotient
|
||||
xx_mod 2 remainder of division
|
||||
xx_int 1 integer part
|
||||
xx_frac 1 fractional part
|
||||
xx_inc 1 increment, default adds 1
|
||||
xx_dec 1 decrement, default subtracts 1
|
||||
xx_square 1 default multiplies by itself
|
||||
xx_scale 2 multiply by power of 2
|
||||
xx_shift 2 shift left by n bits (right if negative)
|
||||
xx_round 2 round to given number of decimal places
|
||||
xx_bround 2 round to given number of binary places
|
||||
xx_root 3 root of value within given error
|
||||
xx_sqrt 2 square root within given error
|
||||
xx_or 2 boolean or
|
||||
xx_and 2 boolean and
|
||||
xx_not 1 boolean not
|
||||
xx_fact 1 factorial
|
||||
|
||||
xx_print 1 print value, default prints elements
|
||||
xx_one 1 multiplicative identity, default is 1
|
||||
xx_test 1 logical test (false,true => 0,1), default tests elements
|
||||
xx_add 2
|
||||
xx_sub 2
|
||||
xx_neg 1 negative
|
||||
xx_mul 2
|
||||
xx_div 2 non-integral division
|
||||
xx_inv 1 multiplicative inverse
|
||||
xx_abs 2 absolute value within given error
|
||||
xx_norm 1 square of absolute value
|
||||
xx_conj 1 conjugate
|
||||
xx_pow 2 integer power, default does multiply, square, inverse
|
||||
xx_sgn 1 sign of value (-1, 0, 1)
|
||||
xx_cmp 2 equality (equal,nonequal => 0,1), default tests elements
|
||||
xx_rel 2 relative order, positive for >, etc.
|
||||
xx_quo 3 integer quotient
|
||||
xx_mod 3 remainder of division
|
||||
xx_int 1 integer part
|
||||
xx_frac 1 fractional part
|
||||
xx_inc 1 increment, default adds 1
|
||||
xx_dec 1 decrement, default subtracts 1
|
||||
xx_square 1 default multiplies by itself
|
||||
xx_scale 2 multiply by power of 2
|
||||
xx_shift 2 shift left by n bits (right if negative)
|
||||
xx_round 3 round to given number of decimal places
|
||||
xx_bround 3 round to given number of binary places
|
||||
xx_root 3 root of value within given error
|
||||
xx_sqrt 3 square root within given error
|
||||
xx_or 2 bitwise or
|
||||
xx_and 2 bitwise and
|
||||
xx_not 1 logical not
|
||||
xx_fact 1 factorial or postfix !
|
||||
xx_min 1 value for min(...)
|
||||
xx_max 1 value for max(...)
|
||||
xx_sum 1 value for sum(...)
|
||||
xx_assign 2 assign, defaults to a = b
|
||||
xx_xor 2 value for binary ~
|
||||
xx_comp 1 value for unary ~
|
||||
xx_content 1 unary hash op
|
||||
xx_hashop 2 binary hash op
|
||||
xx_backslash 1 unary backslash op
|
||||
xx_setminus 2 binary backslash op
|
||||
xx_plus 1 unary + op
|
||||
|
||||
Also see the standard resource files:
|
||||
|
||||
deg.cal
|
||||
dms.cal
|
||||
ellip.cal
|
||||
hms.cal
|
||||
mod.cal
|
||||
natnumset.cal
|
||||
poly.cal
|
||||
quat.cal
|
||||
regress.cal
|
||||
set8700.cal
|
||||
surd.cal
|
||||
test2300.cal
|
||||
test3100.cal
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999,2010 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
|
||||
@@ -195,8 +209,8 @@ Using objects
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: obj.file,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: obj.file,v 30.3 2010/09/02 06:36:21 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/obj.file,v $
|
||||
##
|
||||
## Under source code control: 1991/07/21 04:37:22
|
||||
|
@@ -264,7 +264,7 @@ DESCRIPTION
|
||||
to having their Blum moduli factored, depending in their size,
|
||||
by small PCs in a reasonable to large supercomputers/highly
|
||||
parallel processors over a long time. Their value lies in their
|
||||
speed relative the the default Blum generator. As of Feb 1997,
|
||||
speed relative the default Blum generator. As of Feb 1997,
|
||||
the Blum moduli associated with 13 <= newn < 20 appear to
|
||||
be well beyond the scope of hardware and algorithms,
|
||||
and 9 <= newn < 12 might be factorable with extreme difficulty.
|
||||
@@ -354,8 +354,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: srandom,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: srandom,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/srandom,v $
|
||||
##
|
||||
## Under source code control: 1997/02/17 01:18:22
|
||||
|
132
help/strcmp
132
help/strcmp
@@ -1,66 +1,66 @@
|
||||
NAME
|
||||
strcmp - compare two strings in the customary ordering of strings
|
||||
|
||||
SYNOPSIS
|
||||
strcmp(s1, s2)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
|
||||
return integer (1, 0 or -1)
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2).
|
||||
This function compares up to m values of consecutive characters
|
||||
in the strings s1 and s2. If an inequality is encountered, the
|
||||
function returns 1 or -1 according as the greater character is
|
||||
in s1 or s2. If there has been no inequality, the function
|
||||
returns 1, 0, or -1 according as n1 is greater than, equal to,
|
||||
or less than n2.
|
||||
Note that null characters within the strings are included in the
|
||||
comparison.
|
||||
|
||||
EXAMPLE
|
||||
strcmp("ab", "abc") == -1
|
||||
strcmp("abc", "abb") == 1
|
||||
strcmp("abc", "abc") == 0
|
||||
strcmp("abc", "abd") == -1
|
||||
strcmp("abc\0", "abc") == 1
|
||||
strcmp("a\0b", "a\0c") == -1
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
FLAG stringrel(STRING *s1, STRING *s2)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: strcmp,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcmp,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
NAME
|
||||
strcmp - compare two strings in the customary ordering of strings
|
||||
|
||||
SYNOPSIS
|
||||
strcmp(s1, s2)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
|
||||
return integer (1, 0 or -1)
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2).
|
||||
This function compares up to m values of consecutive characters
|
||||
in the strings s1 and s2. If an inequality is encountered, the
|
||||
function returns 1 or -1 according as the greater character is
|
||||
in s1 or s2. If there has been no inequality, the function
|
||||
returns 1, 0, or -1 according as n1 is greater than, equal to,
|
||||
or less than n2.
|
||||
Note that null characters within the strings are included in the
|
||||
comparison.
|
||||
|
||||
EXAMPLE
|
||||
strcmp("ab", "abc") == -1
|
||||
strcmp("abc", "abb") == 1
|
||||
strcmp("abc", "abc") == 0
|
||||
strcmp("abc", "abd") == -1
|
||||
strcmp("abc\0", "abc") == 1
|
||||
strcmp("a\0b", "a\0c") == -1
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
FLAG stringrel(STRING *s1, STRING *s2)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: strcmp,v 30.3 2013/08/11 01:16:03 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcmp,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
136
help/strcpy
136
help/strcpy
@@ -1,68 +1,68 @@
|
||||
NAME
|
||||
strcpy - copy head or all of a string to head or all of a string
|
||||
|
||||
SYNOPSIS
|
||||
strcpy(s1, s2)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
|
||||
return string
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2).
|
||||
This function replaces the first m characters of s1 by the first
|
||||
m characters of s2, and if m < n1, replaces the next character of
|
||||
s1 by '\0'. The size of s1 and any later characters of s1 are unchanged.
|
||||
s1, with its new value, is returned.
|
||||
Unlike the C Library function with the same name, this function does
|
||||
not require n1 to be greater than or equal to n2, but if this is so,
|
||||
normal printing of the returned value will give the same result as
|
||||
normal printing of s2.
|
||||
|
||||
EXAMPLE
|
||||
strcpy("", "xyz") == ""
|
||||
strcpy("a", "xyz") == "x"
|
||||
strcpy("ab", "xyz") == "xy"
|
||||
strcpy("abc", "xyz") == "xyz"
|
||||
strcpy("abcd", "xyz") == "xyz\0"
|
||||
strcpy("abcde", "xyz") == "xyz\0e"
|
||||
strcpy("abcdef", "xyz") == "xyz\0ef"
|
||||
strcpy("abc", "") == "\0bc"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
STRING* stringcpy(STRING *s1, STRING *s2)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: strcpy,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcpy,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
NAME
|
||||
strcpy - copy head or all of a string to head or all of a string
|
||||
|
||||
SYNOPSIS
|
||||
strcpy(s1, s2)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
|
||||
return string
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2).
|
||||
This function replaces the first m characters of s1 by the first
|
||||
m characters of s2, and if m < n1, replaces the next character of
|
||||
s1 by '\0'. The size of s1 and any later characters of s1 are unchanged.
|
||||
s1, with its new value, is returned.
|
||||
Unlike the C Library function with the same name, this function does
|
||||
not require n1 to be greater than or equal to n2, but if this is so,
|
||||
normal printing of the returned value will give the same result as
|
||||
normal printing of s2.
|
||||
|
||||
EXAMPLE
|
||||
strcpy("", "xyz") == ""
|
||||
strcpy("a", "xyz") == "x"
|
||||
strcpy("ab", "xyz") == "xy"
|
||||
strcpy("abc", "xyz") == "xyz"
|
||||
strcpy("abcd", "xyz") == "xyz\0"
|
||||
strcpy("abcde", "xyz") == "xyz\0e"
|
||||
strcpy("abcdef", "xyz") == "xyz\0ef"
|
||||
strcpy("abc", "") == "\0bc"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
STRING* stringcpy(STRING *s1, STRING *s2)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: strcpy,v 30.3 2013/08/11 01:16:03 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcpy,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
142
help/strncmp
142
help/strncmp
@@ -1,71 +1,71 @@
|
||||
NAME
|
||||
strncmp - compare two strings up to a specified number of characters
|
||||
|
||||
SYNOPSIS
|
||||
strncmp(s1, s2, n)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
n nonnegative integer
|
||||
|
||||
return integer (1, 0 or -1)
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2, n).
|
||||
This function compares up to m values of consecutive characters
|
||||
in the strings s1 and s2. If an inequality is encountered, the
|
||||
function returns 1 or -1 according as the greater character is
|
||||
in s1 or s2. If there has been no inequality, the function
|
||||
returns 1, 0, or -1 according as min(n1, n) is greater than, equal
|
||||
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
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
This function uses FLAG stringrel(STRING *s1, STRING *s2),
|
||||
temporarily replacing the string sizes by min(n1,n) and min(n2,n).
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: strncmp,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strncmp,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
NAME
|
||||
strncmp - compare two strings up to a specified number of characters
|
||||
|
||||
SYNOPSIS
|
||||
strncmp(s1, s2, n)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
n nonnegative integer
|
||||
|
||||
return integer (1, 0 or -1)
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2, n).
|
||||
This function compares up to m values of consecutive characters
|
||||
in the strings s1 and s2. If an inequality is encountered, the
|
||||
function returns 1 or -1 according as the greater character is
|
||||
in s1 or s2. If there has been no inequality, the function
|
||||
returns 1, 0, or -1 according as min(n1, n) is greater than, equal
|
||||
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
|
||||
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
This function uses FLAG stringrel(STRING *s1, STRING *s2),
|
||||
temporarily replacing the string sizes by min(n1,n) and min(n2,n).
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncpy, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: strncmp,v 30.3 2013/08/11 01:16:03 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strncmp,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
132
help/strncpy
132
help/strncpy
@@ -1,66 +1,66 @@
|
||||
NAME
|
||||
strncpy - copy a number of chracters from head or all of a stringr
|
||||
to head or all of a string
|
||||
|
||||
SYNOPSIS
|
||||
strncpy(s1, s2, n)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
n nonnegative integer
|
||||
|
||||
return string
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2, n).
|
||||
This function replaces the first m characters of s1 by the first
|
||||
m characters of s2, and if min(n1, n) > n2, replaces the next
|
||||
min(n1,n) - n2 characters of s1 by '\0'. The size of s1 and any
|
||||
later characters of s1 are unchanged. The function returns s1, with
|
||||
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"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
STRING* stringncpy(STRING *s1, STRING *s2, long num)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: strncpy,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strncpy,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
NAME
|
||||
strncpy - copy a number of chracters from head or all of a stringr
|
||||
to head or all of a string
|
||||
|
||||
SYNOPSIS
|
||||
strncpy(s1, s2, n)
|
||||
|
||||
TYPES
|
||||
s1 string
|
||||
s2 string
|
||||
n nonnegative integer
|
||||
|
||||
return string
|
||||
|
||||
DESCRIPTION
|
||||
Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2, n).
|
||||
This function replaces the first m characters of s1 by the first
|
||||
m characters of s2, and if min(n1, n) > n2, replaces the next
|
||||
min(n1,n) - n2 characters of s1 by '\0'. The size of s1 and any
|
||||
later characters of s1 are unchanged. The function returns s1, with
|
||||
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"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
STRING* stringncpy(STRING *s1, STRING *s2, long num)
|
||||
|
||||
SEE ALSO
|
||||
strcat, strcpy, strerror, strlen, strncmp, strpos,
|
||||
strprintf, strscan, strscanf, substr
|
||||
|
||||
## Copyright (C) 2006 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
|
||||
## as published by the Free Software Foundation.
|
||||
##
|
||||
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
## Public License for more details.
|
||||
##
|
||||
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: strncpy,v 30.3 2013/08/11 01:16:03 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strncpy,v $
|
||||
##
|
||||
## Under source code control: 2006/03/03 03:32:44
|
||||
## File existed as early as: 2006
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
|
@@ -69,7 +69,7 @@ DESCRIPTION
|
||||
might be taken to suggest a number like +2345; 'r' might suggest
|
||||
a representation like -27/49; 'e' might suggest a representation like
|
||||
1.24e-7; 'f' might suggest a representation like 27.145. However, there
|
||||
is no test that the the result conforms to the specifier. Whatever
|
||||
is no test that the result conforms to the specifier. Whatever
|
||||
the specifier in these cases, the result depends on the characters read
|
||||
until a space or other exceptional character is read. The
|
||||
characters read may include one or more occurrences of +, -, * as
|
||||
@@ -131,8 +131,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: strscanf,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: strscanf,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strscanf,v $
|
||||
##
|
||||
## Under source code control: 1996/04/30 03:05:18
|
||||
|
@@ -17,7 +17,7 @@ DESCRIPTION
|
||||
x.y
|
||||
|
||||
where x, y, z, w, v are integers (without leading 0's) and,
|
||||
t is the the liternal character 't'.
|
||||
t is the liternal character 't'.
|
||||
|
||||
EXAMPLE
|
||||
; version()
|
||||
@@ -48,8 +48,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: version,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: version,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/version,v $
|
||||
##
|
||||
## Under source code control: 2001/05/28 17:38:01
|
||||
|
Reference in New Issue
Block a user