diff --git a/CHANGES b/CHANGES index b380094..93c2a96 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ -The following are the changes from calc version 2.11.6.0 to date: +The following are the changes from calc version 2.11.6.3 to date: + + Fixed a bug in deg.cal where fixdms() was being called with + the wrong type of argument. + + +The following are the changes from calc version 2.11.6.0 to 2.11.6.2: Clarified remark in lucas.cal about use of n mod 2^n == 0. @@ -82,6 +88,8 @@ The following are the changes from calc version 2.11.6.0 to date: Fixed formation of the custom/.all file. + Fixed repeat(1, repeat_count) bug. + The following are the changes from calc version 2.11.5.5 to 2.11.5.9: @@ -5506,8 +5514,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## -## @(#) $Revision: 29.53 $ -## @(#) $Id: CHANGES,v 29.53 2003/01/14 02:33:58 chongo Exp $ +## @(#) $Revision: 29.55 $ +## @(#) $Id: CHANGES,v 29.55 2003/01/21 11:14:15 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $ ## ## Under source code control: 1993/06/02 18:12:57 diff --git a/cal/deg.cal b/cal/deg.cal index 68db86b..6800a9b 100644 --- a/cal/deg.cal +++ b/cal/deg.cal @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: deg.cal,v 29.2 2000/06/07 14:02:25 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: deg.cal,v 29.3 2003/01/21 11:12:37 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/deg.cal,v $ * * Under source code control: 1990/02/15 01:50:33 @@ -42,7 +42,7 @@ define dms(deg, min, sec) ans.deg = deg; ans.min = min; ans.sec = sec; - fixdms(&ans); + fixdms(ans); return ans; } @@ -66,7 +66,7 @@ define dms_add(a, b) ans.sec += b.sec; } else ans.deg += b; - fixdms(&ans); + fixdms(ans); return ans; } @@ -103,7 +103,7 @@ define dms_mul(a, b) ans.min = b.min * a; ans.sec = b.sec * a; } - fixdms(&ans); + fixdms(ans); return ans; } diff --git a/cal/repeat.cal b/cal/repeat.cal index 525973e..4d19cff 100644 --- a/cal/repeat.cal +++ b/cal/repeat.cal @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: repeat.cal,v 29.2 2003/01/14 01:55:22 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: repeat.cal,v 29.3 2003/01/14 04:03:20 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/repeat.cal,v $ * * Under source code control: 2003/01/05 00:00:01 @@ -48,6 +48,6 @@ define repeat(digit_set, repeat_count) } /* return repeated set of digits */ - digit_count = digits(digit_set); + digit_count = max(digits(digit_set), 1); return digit_set * (10^(digit_count*repeat_count)-1) / (10^digit_count-1); } diff --git a/calc.man b/calc.man index 7c5c25b..080ebcb 100644 --- a/calc.man +++ b/calc.man @@ -15,8 +15,8 @@ .\" received a copy with calc; if not, write to Free Software Foundation, Inc. .\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. .\" -.\" @(#) $Revision: 29.9 $ -.\" @(#) $Id: calc.man,v 29.9 2002/03/14 00:28:28 chongo Exp $ +.\" @(#) $Revision: 29.10 $ +.\" @(#) $Id: calc.man,v 29.10 2003/01/18 21:19:21 chongo Exp $ .\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $ .\" .\" Under source code control: 1991/07/23 05:48:26 @@ -1086,7 +1086,7 @@ Landon Noll maintains the the web site is located at: .sp .in +0.5i -http://www.isthe.com/chongo/tech/comp/calc/ +www.isthe.com/chongo/tech/comp/calc/ .in -0.5i .sp Share and Enjoy! :\-) diff --git a/help/digits b/help/digits index 327b627..1f4f762 100644 --- a/help/digits +++ b/help/digits @@ -13,12 +13,15 @@ TYPES DESCRIPTION Returns the least non-negative integer n for which abs(x) < b^n. - digits(x, b) = 0 if and only if abs(x) < 1. + digits(x, b) = 0 if and only if abs(x) <= 1. - For real x with absolute value >= 1, digits(x, b) is the number + For real x with absolute value > 1, digits(x, b) is the number of digits in the standard base-b "decimal" representation of int(abs(x)); this is also given by 1 + ilog(x, b). + NOTE: both digits(0) and digits(1) return the value of 1. + This is not a bug, it is a feature of the above equation. :-) + EXAMPLE > print digits(0), digits(0.0123), digits(3.7), digits(-27), digits(-99.7) 0 0 1 2 2 @@ -32,7 +35,7 @@ LINK LIBRARY SEE ALSO digit, places -## Copyright (C) 1999 Landon Curt Noll +## Copyright (C) 1999-2003 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 @@ -48,8 +51,8 @@ SEE ALSO ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## -## @(#) $Revision: 29.3 $ -## @(#) $Id: digits,v 29.3 2000/12/14 10:32:24 chongo Exp $ +## @(#) $Revision: 29.4 $ +## @(#) $Id: digits,v 29.4 2003/01/14 04:09:35 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $ ## ## Under source code control: 1995/10/03 10:40:01 diff --git a/version.c b/version.c index 6dd47ad..d9c65d3 100644 --- a/version.c +++ b/version.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.42 $ - * @(#) $Id: version.c,v 29.42 2003/01/14 01:51:46 chongo Exp $ + * @(#) $Revision: 29.44 $ + * @(#) $Id: version.c,v 29.44 2003/01/21 11:14:15 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $ * * Under source code control: 1990/05/22 11:00:58 @@ -46,7 +46,7 @@ static char *program; #define MAJOR_VER 2 /* major version */ #define MINOR_VER 11 /* minor version */ #define MAJOR_PATCH 6 /* patch level or 0 if no patch */ -#define MINOR_PATCH 1 /* test number or 0 if no minor patch */ +#define MINOR_PATCH 3 /* test number or 0 if no minor patch */ /*