Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package calc for openSUSE:Factory checked in at 2021-09-07 21:21:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/calc (Old) and /work/SRC/openSUSE:Factory/.calc.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "calc" Tue Sep 7 21:21:38 2021 rev:26 rq:917248 version:2.14.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/calc/calc.changes 2021-05-15 01:24:29.630960418 +0200 +++ /work/SRC/openSUSE:Factory/.calc.new.1899/calc.changes 2021-09-07 21:22:23.321373111 +0200 @@ -1,0 +2,26 @@ +Tue Sep 7 10:11:36 UTC 2021 - Michael Vetter <[email protected]> + +- Update to 2.14.0.0: + * The :-separated default CALCRC value has been reversed. + The default CALCRC was: + ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit + The default CALCRC is now: + ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup + See "help environment" for details. + * Added engineering mode as per a GitHub pull request: + ; config("mode","eng"), + ; 10^41 + 100e39 + or for example: + ; base(1000), + ; 2^23209-1 + ~402.87411577898877818187e6984 + For more information see: help base + * Added regression test code for engineering mode. Improved and + expanded regression test code related to the base() and base2() + builtin functions. + * Fixed a critical bug in the above mentioned pull request where + a call to base2(1000) would make calc unstable and likely to + dump core. + +------------------------------------------------------------------- Old: ---- calc-2.13.0.1.tar.bz2 New: ---- calc-2.14.0.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ calc.spec ++++++ --- /var/tmp/diff_new_pack.Ml7WjQ/_old 2021-09-07 21:22:23.889373798 +0200 +++ /var/tmp/diff_new_pack.Ml7WjQ/_new 2021-09-07 21:22:23.893373802 +0200 @@ -19,7 +19,7 @@ %define soname 2 %define libname libcalc%{soname} Name: calc -Version: 2.13.0.1 +Version: 2.14.0.0 Release: 0 Summary: C-style arbitrary precision calculator License: LGPL-2.1-only ++++++ calc-2.13.0.1.tar.bz2 -> calc-2.14.0.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/CHANGES new/calc-2.14.0.0/CHANGES --- old/calc-2.13.0.1/CHANGES 2021-04-17 08:48:29.000000000 +0200 +++ new/calc-2.14.0.0/CHANGES 2021-09-07 08:05:16.000000000 +0200 @@ -1,4 +1,43 @@ -The following are the changes from calc version 2.13.0.1 to date: +The following are the changes from calc version 2.14.0.0 to date: + + The :-separated default CALCRC value has been reversed. + The default CALCRC was: + + ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit + + The default CALCRC is now: + + ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup + + See "help environment" for details. + + Added engineering mode as per a GitHub pull request from + <GitHub user heitzmann>. Thank you! For example: + + ; config("mode","eng"), + ; 10^41 + 100e39 + + or for example: + + ; base(1000), + ; 2^23209-1 + ~402.87411577898877818187e6984 + + For more information see: + + help base + + Added regression test code for engineering mode. Improved and + expanded regression test code related to the base() and base2() + builtin functions. + + Fixed a critical bug in the above mentioned pull request where + a call to base2(1000) would make calc unstable and likely to + dump core. + + +The following are the changes from calc version 2.13.0.1 to 2.13.0.1: Replaced /usr/local with the use of ${PREFIX} in calc Makefiles. @@ -31,7 +70,7 @@ Updated HOWTO.INSTALL to mention Makefile.local. -The following are the changes from calc version 2.13.0.0 to date: +The following are the changes from calc version 2.13.0.0 to 2.13.0.0: Fixed typo (missing quotes) in the env rule. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/Makefile new/calc-2.14.0.0/Makefile --- old/calc-2.13.0.1/Makefile 2021-04-11 12:24:51.000000000 +0200 +++ new/calc-2.14.0.0/Makefile 2021-09-07 04:27:44.000000000 +0200 @@ -1007,10 +1007,10 @@ # If the $CALCRC environment variable is not defined, then the following # path will be searched for calc resource files. # -# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP. +# Select CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup for DJGPP. # -CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit -#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit +CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup +#CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup # Determine of the GNU-readline facility will be used instead of the # builtin calc binding method. @@ -1198,7 +1198,7 @@ # The default calc versions # -VERSION= 2.13.0.1 +VERSION= 2.14.0.0 # Names of shared libraries with versions # @@ -1794,7 +1794,7 @@ else CALCPATH= .;./cal;~/.cal;${T}${CALC_SHAREDIR} endif -CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit +CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup # BLD_TYPE= calc-static-only # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/Makefile.simple new/calc-2.14.0.0/Makefile.simple --- old/calc-2.13.0.1/Makefile.simple 2021-04-17 08:54:05.000000000 +0200 +++ new/calc-2.14.0.0/Makefile.simple 2021-09-07 08:27:19.000000000 +0200 @@ -926,10 +926,10 @@ # If the $CALCRC environment variable is not defined, then the following # path will be searched for calc resource files. # -# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP. +# Select CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup for DJGPP. # -CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit -#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit +CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup +#CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup # Determine of the GNU-readline facility will be used instead of the # builtin calc binding method. @@ -1117,7 +1117,7 @@ # The default calc versions # -VERSION= 2.13.0.1 +VERSION= 2.14.0.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/README.WINDOWS new/calc-2.14.0.0/README.WINDOWS --- old/calc-2.13.0.1/README.WINDOWS 2018-01-21 20:41:30.000000000 +0100 +++ new/calc-2.14.0.0/README.WINDOWS 2021-09-07 01:36:22.000000000 +0200 @@ -126,7 +126,7 @@ CATDIR= /dev/env/DJDIR/man/cat1 NROFF= groff CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} - CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit + CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup CALCPAGER= less.exe -ci DEBUG= -O2 -gstabs+ -DWINDOZ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/cal/regress.cal new/calc-2.14.0.0/cal/regress.cal --- old/calc-2.13.0.1/cal/regress.cal 2021-02-16 07:35:56.000000000 +0100 +++ new/calc-2.14.0.0/cal/regress.cal 2021-09-07 04:20:42.000000000 +0200 @@ -1881,96 +1881,298 @@ vrfy(tmp == "octal", '1620: tmp == "octal"'); vrfy(base() == 2, '1621: base() == 2'); - tmp = config("mode", "real"); - print '1622: tmp = config("mode", "real")'; + tmp = config("mode", "eng"); + print '1622: tmp = config("mode", "eng")'; vrfy(tmp == "binary", '1623: tmp == "binary"'); + vrfy(base() == 1000, '1624: base() == 1000'); + + tmp = config("mode", "real"); + print '1625: tmp = config("mode", "real")'; + vrfy(tmp == "engineering", '1626: tmp == "engineering"'); tmp = base(1/3); - print '1624: tmp = base(1/3)'; + print '1627: tmp = base(1/3)'; vrfy(config("mode") == "fraction", - '1625: config("mode") == "fraction"'); + '1628: config("mode") == "fraction"'); tmp = base(-10); - print '1626: tmp = base(-10)'; + print '1629: tmp = base(-10)'; vrfy(config("mode") == "integer", - '1627: config("mode") == "integer"'); + '1630: config("mode") == "integer"'); tmp = base(10); - print '1628: tmp = base(10)'; - vrfy(config("mode") == "real", '1629: config("mode") == "real"'); + print '1631: tmp = base(10)'; + vrfy(config("mode") == "real", '1632: config("mode") == "real"'); tmp = base(1e20); - print '1630: tmp = base(1e20)'; + print '1633: tmp = base(1e20)'; vrfy(config("mode") == "scientific", - '1631: config("mode") == "scientific"'); + '1634: config("mode") == "scientific"'); tmp = base(16); - print '1632: tmp = base(16)'; + print '1635: tmp = base(16)'; vrfy(config("mode") == "hexadecimal", \ - '1633: config("mode") == "hexadecimal"'); + '1636: config("mode") == "hexadecimal"'); tmp = base(8); - print '1634: tmp = base(8)'; - vrfy(config("mode") == "octal", '1635: config("mode") == "octal"'); + print '1637: tmp = base(8)'; + vrfy(config("mode") == "octal", '1638: config("mode") == "octal"'); tmp = base(2); - print '1636: tmp = base(2)'; - vrfy(config("mode") == "binary",'1637: config("mode") == "binary"'); + print '1639: tmp = base(2)'; + vrfy(config("mode") == "binary",'1640: config("mode") == "binary"'); + + tmp = base(1000); + print '1641: tmp = base(1000)'; + vrfy(config("mode") == "engineering", + '1642: config("mode") == "engineering"'); + + tmp = base(1/3); + print '1643: tmp = base(1/3)'; + vrfy(str(0x80000000) == "2147483648", \ + '1644: str(0x8000000) == \"2147483648\"'); + vrfy(str(0xffffffff) == "4294967295", \ + '1645: str(0xffffffff) == \"4294967295\"'); + vrfy(str(3e9) == "3000000000", \ + '1646: str(3e9) == \"3000000000\"'); + vrfy(str(1/3) == "1/3", \ + '1647: str(1/3) == \"1/3\"'); + vrfy(str(2e8) == "200000000", \ + '1648: str(2e8) == \"200000000"'); + vrfy(str(200e6) == "200000000", \ + '1649: str(200e6) == \"200000000"'); + vrfy(str(0b100111) == "39", \ + '1650: str(0b100111) == \"39"'); + vrfy(str(07543) == "3939", \ + '1651: str(07543) == \"3939"'); + vrfy(str(7543) == "7543", \ + '1652: str(7543) == \"7543"'); tmp = base(8); - print '1638: tmp = base(8)'; + print '1653: tmp = base(8)'; vrfy(str(0x80000000) == "020000000000", \ - '1639: str(0x8000000) == \"020000000000\"'); + '1654: str(0x8000000) == \"020000000000\"'); vrfy(str(0xffffffff) == "037777777777", \ - '1640: str(0xffffffff) == \"037777777777\"'); + '1655: str(0xffffffff) == \"037777777777\"'); vrfy(str(3e9) == "026264057000", \ - '1641: str(3e9) == \"026264057000\"'); + '1656: str(3e9) == \"026264057000\"'); + vrfy(str(1/3) == "1/3", \ + '1657: str(1/3) == \"1/3\"'); + vrfy(str(2e8) == "01372741000", \ + '1658: str(2e8) == \"01372741000"'); + vrfy(str(200e6) == "01372741000", \ + '1659: str(200e6) == \"01372741000"'); + vrfy(str(0b100111) == "047", \ + '1660: str(0b100111) == \"047"'); + vrfy(str(07543) == "07543", \ + '1661: str(07543) == \"07543"'); + vrfy(str(7543) == "016567", \ + '1662: str(7543) == \"016567"'); tmp = base(16); - print '1642: tmp = base(16)'; + print '1663: tmp = base(16)'; vrfy(str(0x80000000) == "0x80000000", \ - '1643: str(0x8000000) == \"0x80000000\"'); + '1664: str(0x8000000) == \"0x80000000\"'); vrfy(str(0xffffffff) == "0xffffffff", \ - '1644: str(0xffffffff) == \"0xffffffff\"'); + '1665: str(0xffffffff) == \"0xffffffff\"'); vrfy(str(3e9) == "0xb2d05e00", \ - '1645: str(3e9) == \"0xb2d05e00\"'); + '1666: str(3e9) == \"0xb2d05e00\"'); + vrfy(str(1/3) == "1/3", \ + '1667: str(1/3) == \"1/3\"'); + vrfy(str(2e8) == "0xbebc200", \ + '1668: str(2e8) == \"0xbebc200"'); + vrfy(str(200e6) == "0xbebc200", \ + '1669: str(200e6) == \"0xbebc200"'); + vrfy(str(0b100111) == "0x27", \ + '1670: str(0b100111) == \"0x27"'); + vrfy(str(07543) == "0xf63", \ + '1671: str(07543) == \"0xf63"'); + vrfy(str(7543) == "0x1d77", \ + '1672: str(7543) == \"0x1d77"'); - tmp = base(10); - print '1646: tmp = base(10)'; - vrfy(config("mode") == "real", \ - '1647: config("mode") == "real"'); + tmp = base(2); + print '1673: tmp = base(2)'; + vrfy(str(0x80000000) == "0b10000000000000000000000000000000", \ + '1674: str(0x8000000) == \"0b10000000000000000000000000000000\"'); + vrfy(str(0xffffffff) == "0b11111111111111111111111111111111", \ + '1675: str(0xffffffff) == \"0b11111111111111111111111111111111\"'); + vrfy(str(3e9) == "0b10110010110100000101111000000000", \ + '1676: str(3e9) == \"0b10110010110100000101111000000000\"'); + vrfy(str(1/3) == "1/0b11", \ + '1677: str(1/3) == \"1/0b11\"'); + vrfy(str(2e8) == "0b1011111010111100001000000000", \ + '1678: str(2e8) == \"0b1011111010111100001000000000"'); + vrfy(str(200e6) == "0b1011111010111100001000000000", \ + '1679: str(200e6) == \"0b1011111010111100001000000000"'); + vrfy(str(0b100111) == "0b100111", \ + '1680: str(0b100111) == \"0b100111"'); + vrfy(str(07543) == "0b111101100011", \ + '1681: str(07543) == \"0b111101100011"'); + vrfy(str(7543) == "0b1110101110111", \ + '1682: str(7543) == \"0b1110101110111"'); + + tmp = base(1e20); + print '1683: tmp = base(1e20)'; + vrfy(str(0x80000000) == "2.147483648e9", \ + '1684: str(0x8000000) == \"2.147483648e9\"'); + vrfy(str(0xffffffff) == "4.294967295e9", \ + '1685: str(0xffffffff) == \"4.294967295e9\"'); + vrfy(str(3e9) == "3e9", \ + '1686: str(3e9) == \"3e9\"'); + vrfy(str(1/3) == "~3.33333333333333333333e-1", \ + '1687: str(1/3) == \"~3.33333333333333333333e-1\"'); + vrfy(str(2e8) == "2e8", \ + '1688: str(2e8) == \"2e8"'); + vrfy(str(200e6) == "2e8", \ + '1689: str(200e6) == \"2e8"'); + vrfy(str(0b100111) == "3.9e1", \ + '1690: str(0b100111) == \"3.9e1"'); + vrfy(str(07543) == "3.939e3", \ + '1691: str(07543) == \"3.939e3"'); + vrfy(str(7543) == "7.543e3", \ + '1692: str(7543) == \"7.543e3"'); + + tmp = base(1000); + print '1693: tmp = base(1000)'; + vrfy(str(0x80000000) == "2.147483648e9", \ + '1694: str(0x8000000) == \"2.147483648e9"'); + vrfy(str(0xffffffff) == "4.294967295e9", \ + '1695: str(0xffffffff) == \"4.294967295e9\"'); + vrfy(str(3e9) == "3e9", \ + '1696: str(3e9) == \"3e9\"'); + vrfy(str(1/3) == "~333.33333333333333333333e-3", \ + '1697: str(1/3) == \"~333.33333333333333333333e-3\"'); + vrfy(str(2e8) == "200e6", \ + '1698: str(2e8) == \"200e6"'); + vrfy(str(200e6) == "200e6", \ + '1699: str(200e6) == \"200e6"'); + vrfy(str(0b100111) == "39", \ + '1700: str(0b100111) == \"39"'); + vrfy(str(07543) == "3.939e3", \ + '1701: str(07543) == \"3.939e3"'); + vrfy(str(7543) == "7.543e3", \ + '1702: str(7543) == \"7.543e3"'); + tmp = base(-10); + print '1703: tmp = base(-10)'; vrfy(str(0x80000000) == "2147483648", \ - '1648: str(0x80000000) == \"2147483648\"'); + '1704: str(0x8000000) == \"2147483648\"'); vrfy(str(0xffffffff) == "4294967295", \ - '1649: str(0xffffffff) == \"4294967295\"'); + '1705: str(0xffffffff) == \"4294967295\"'); vrfy(str(3e9) == "3000000000", \ - '1650: str(3e9) == \"3000000000\"'); + '1706: str(3e9) == \"3000000000\"'); + vrfy(str(1/3) == "~0", \ + '1707: str(1/3) == \"~0\"'); + vrfy(str(2e8) == "200000000", \ + '1708: str(2e8) == \"200000000"'); + vrfy(str(200e6) == "200000000", \ + '1709: str(200e6) == \"200000000"'); + vrfy(str(0b100111) == "39", \ + '1710: str(0b100111) == \"39"'); + vrfy(str(07543) == "3939", \ + '1711: str(07543) == \"3939"'); + vrfy(str(7543) == "7543", \ + '1712: str(7543) == \"7543"'); + + tmp = base(10); + print '1713: tmp = base(10)'; + vrfy(str(0x80000000) == "2147483648", \ + '1714: str(0x8000000) == \"2147483648\"'); + vrfy(str(0xffffffff) == "4294967295", \ + '1715: str(0xffffffff) == \"4294967295\"'); + vrfy(str(3e9) == "3000000000", \ + '1716: str(3e9) == \"3000000000\"'); + vrfy(str(1/3) == "~0.33333333333333333333", \ + '1717: str(1/3) == \"~0.33333333333333333333"'); + vrfy(str(2e8) == "200000000", \ + '1718: str(2e8) == \"200000000"'); + vrfy(str(200e6) == "200000000", \ + '1719: str(200e6) == \"200000000"'); + vrfy(str(0b100111) == "39", \ + '1720: str(0b100111) == \"39"'); + vrfy(str(07543) == "3939", \ + '1721: str(07543) == \"3939"'); + vrfy(str(7543) == "7543", \ + '1722: str(7543) == \"7543"'); /* test base2() functionality */ - vrfy(base2() == 0, '1651: base2() == 0'); - vrfy(base2(0) == 0, '1652: base2(0) == 0'); - vrfy(base2() == 0, '1653: base2() == 0'); - vrfy(base2(16) == 0, '1654: base2(16) == 0'); - vrfy(base2() == 16, '1655: base2() == 16'); + vrfy(base2() == 0, '1723: base2() == 0'); + vrfy(base2(0) == 0, '1724: base2(0) == 0'); + vrfy(base2() == 0, '1725: base2() == 0'); + + vrfy(base2(16) == 0, '1726: base2(16) == 0'); + vrfy(base2() == 16, '1727: base2() == 16'); vrfy(str(3e9) == "3000000000 /* 0xb2d05e00 */", - '1656: str(3e9) == "3000000000 /* 0xb2d05e00 */"'); - vrfy(base2(1/3) == 16, '1657: base2(16) == 16'); + '1728: str(3e9) == "3000000000 /* 0xb2d05e00 */"'); + + vrfy(base2(1/3) == 16, '1728: base2(16) == 16'); + vrfy(base2() == 1/3, '1729: base2() == 1/3'); vrfy(str(23209) == "23209 /* 23209 */", - '1658: str(23209) == "23209 /* 23209 */"'); + '1730: str(23209) == "23209 /* 23209 */"'); + vrfy(str(3/2) == "1.5 /* 3/2 */", + '1731: str(3/2) == "1.5 /* 3/2 */"'); + + vrfy(base2(8) == 1/3, '1732: base2(8) == 1/3'); + vrfy(base2() == 8, '1733: base2() == 8'); + vrfy(str(23209) == "23209 /* 055251 */", + '1734: str(23209) == "23209 /* 055251 */"'); vrfy(str(3/2) == "1.5 /* 3/2 */", - '1659: str(3/2) == "1.5 /* 3/2 */"'); - vrfy(base() == 10, '1660: base() == 10'); - vrfy(base2(0) == 1/3, '1661: base2(0) == 1/3'); + '1735: str(3/2) == "1.5 /* 3/2 */"'); + + vrfy(base2(2) == 8, '1736: base2(2) == 8'); + vrfy(base2() == 2, '1737: base2() == 2'); + vrfy(str(23209) == "23209 /* 0b101101010101001 */", + '1738: str(23209) == "23209 /* 0b101101010101001 */"'); + vrfy(str(3/2) == "1.5 /* 0b11/0b10 */", + '1739: str(3/2) == "1.5 /* 0b11/0b10 */"'); + + vrfy(base2(1e20) == 2, '1740: base2(1e20) == 2'); + vrfy(base2() == 1e20, '1741: base2() == 1e20'); + vrfy(str(23209) == "23209 /* 2.3209e4 */", + '1742: str(23209) == "23209 /* 2.3209e4 */"'); + vrfy(str(3/2) == "1.5 /* 1.5 */", + '1743: str(3/2) == "1.5 /* 1.5 */"'); - print '1662: Ending mode/base test'; + vrfy(base2(-10) == 1e20, '1744: base2(-10) == 1e20'); + vrfy(base2() == -10, '1745: base2() == -10'); + vrfy(str(23209) == "23209 /* 23209 */", + '1746: str(23209) == "23209 /* 23209 */"'); + vrfy(str(3/2) == "1.5 /* ~2 */", + '1747: str(3/2) == "1.5 /* ~2 */"'); + + vrfy(base2(1000) == -10, '1748: base2(1000) == -1000'); + vrfy(base2() == 1000, '1749: base2() == 1000'); + vrfy(str(23209) == "23209 /* 23.209e3 */", + '1750: str(23209) == "23209 /* 23.209e3 */"'); + vrfy(str(3/2) == "1.5 /* 1.5 */", + '1751: str(3/2) == "1.5 /* 1.5 */"'); + + vrfy(base2(10) == 1000, '1752: base2(10) == 1000'); + vrfy(base2() == 10, '1753: base2() == 10'); + vrfy(str(23209) == "23209 /* 23209 */", + '1754: str(23209) == "23209 /* 23209 */"'); + vrfy(str(3/2) == "1.5 /* 1.5 */", + '1755: str(3/2) == "1.5 /* 1.5 */"'); + + vrfy(base2(0) == 10, '1756: base2(0) == 10'); + vrfy(base2() == 0, '1757: base2() == 0'); + vrfy(str(23209) == "23209", + '1758: str(23209) == "23209"'); + vrfy(str(3/2) == "1.5", + '1759: str(3/2) == "1.5"'); + + vrfy(base() == 10, '1760: base() == 10'); + vrfy(base2() == 0, '1761: base2() == 0'); + + print '1762: Ending mode/base test'; } print '026: parsed test_mode()'; /* - * The 1700's contain tests for reading resource files. These tests are - * done inline near the bottom. + * The 1780's and 1790's contain tests for reading resource files. + * + * These tests are done inline near the bottom. */ @@ -7635,31 +7837,31 @@ return test_mode(); print; -print '1700: Beginning read test'; +print '1780: Beginning read test'; value = 0; -vrfy(value == 0, '1701: value == 0'); +vrfy(value == 0, '1781: value == 0'); read "test1700"; -print '1702: read "test1700";'; -vrfy(value == 1, '1703: value == 1'); +print '1782: read "test1700";'; +vrfy(value == 1, '1783: value == 1'); read -once "test1700"; -print '1704: read -once "test1700";'; -vrfy(value == 1, '1705: value == 1'); +print '1784: read -once "test1700";'; +vrfy(value == 1, '1785: value == 1'); read "test1700.cal"; -print '1706: read "test1700.cal";'; -vrfy(value == 2, '1707: value == 2'); -read -once "test1700.cal"; -print '1708: read -once "test1700.cal";'; -vrfy(value == 2, '1709: value == 2'); +print '1786: read "test1700.cal";'; +vrfy(value == 2, '1787: value == 2'); +read -once "test1700.cal" +print '1788: read -once "test1700.cal";'; +vrfy(value == 2, '1789: value == 2'); read "test1700.cal"; -print '1710: read "test1700.cal";'; -vrfy(value == 3, '1711: value == 3'); +print '1790: read "test1700.cal";'; +vrfy(value == 3, '1791: value == 3'); {++value;} read "test1700.cal"; -print '1712: {++value;} read "test1700.cal";'; -vrfy(value == 5, '1713: value == 5'); +print '1792: {++value;} read "test1700.cal";'; +vrfy(value == 5, '1793: value == 5'); {++value;} read -once "test1700.cal"; -print '1714: {++value;} read -once "test1700.cal";'; -vrfy(value == 6, '1715: value == 6'); -print '1716: Ending read test'; +print '1794: {++value;} read -once "test1700.cal";'; +vrfy(value == 6, '1795: value == 6'); +print '1796: Ending read test'; print; return test_obj(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/config.c new/calc-2.14.0.0/config.c --- old/calc-2.13.0.1/config.c 2021-03-09 10:06:49.000000000 +0100 +++ new/calc-2.14.0.0/config.c 2021-09-07 01:57:28.000000000 +0200 @@ -274,6 +274,8 @@ {"scientific", MODE_EXP}, {"sci", MODE_EXP}, {"exp", MODE_EXP}, + {"engineering", MODE_ENG}, + {"eng", MODE_ENG}, {"hexadecimal", MODE_HEX}, {"hex", MODE_HEX}, {"octal", MODE_OCTAL}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/custom/Makefile new/calc-2.14.0.0/custom/Makefile --- old/calc-2.13.0.1/custom/Makefile 2021-04-17 08:53:22.000000000 +0200 +++ new/calc-2.14.0.0/custom/Makefile 2021-09-07 08:26:36.000000000 +0200 @@ -489,7 +489,7 @@ # The default calc versions # -VERSION= 2.13.0.1 +VERSION= 2.14.0.0 # Names of shared libraries with versions # @@ -1077,7 +1077,7 @@ else CALCPATH= .;./cal;~/.cal;${T}${CALC_SHAREDIR} endif -CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit +CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup # BLD_TYPE= calc-static-only # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/custom/Makefile.head new/calc-2.14.0.0/custom/Makefile.head --- old/calc-2.13.0.1/custom/Makefile.head 2021-04-09 21:37:24.000000000 +0200 +++ new/calc-2.14.0.0/custom/Makefile.head 2021-09-07 04:27:44.000000000 +0200 @@ -489,7 +489,7 @@ # The default calc versions # -VERSION= 2.13.0.1 +VERSION= 2.14.0.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/custom/Makefile.simple new/calc-2.14.0.0/custom/Makefile.simple --- old/calc-2.13.0.1/custom/Makefile.simple 2021-04-17 08:54:05.000000000 +0200 +++ new/calc-2.14.0.0/custom/Makefile.simple 2021-09-07 08:27:19.000000000 +0200 @@ -460,7 +460,7 @@ # The default calc versions # -VERSION= 2.13.0.1 +VERSION= 2.14.0.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/file.c new/calc-2.14.0.0/file.c --- old/calc-2.13.0.1/file.c 2021-03-09 10:06:54.000000000 +0100 +++ new/calc-2.14.0.0/file.c 2021-09-07 01:57:28.000000000 +0200 @@ -1048,6 +1048,9 @@ case 'e': newmode = MODE_EXP; break; + case 'n': + newmode = MODE_ENG; + break; case 'g': newmode = MODE_REAL_AUTO; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/func.c new/calc-2.14.0.0/func.c --- old/calc-2.13.0.1/func.c 2021-03-27 11:41:41.000000000 +0100 +++ new/calc-2.14.0.0/func.c 2021-09-07 04:06:43.000000000 +0200 @@ -7839,6 +7839,9 @@ case 16: oldbase = math_setmode(MODE_HEX); break; + case 1000: + oldbase = math_setmode(MODE_ENG); + break; default: math_error("Unsupported base"); /*NOTREACHED*/ @@ -7893,6 +7896,9 @@ case 16: oldbase = math_setmode2(MODE_HEX); break; + case 1000: + oldbase = math_setmode2(MODE_ENG); + break; default: math_error("Unsupported base"); /*NOTREACHED*/ @@ -7933,6 +7939,9 @@ result = qalloc(); ztenpow(20, &result->num); break; + case MODE_ENG: + result = itoq(1000); + break; case MODE_HEX: result = itoq(16); break; @@ -7964,6 +7973,9 @@ result = qalloc(); ztenpow(20, &result->num); break; + case MODE_ENG: + result = itoq(1000); + break; case MODE_HEX: result = itoq(16); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/help/base new/calc-2.14.0.0/help/base --- old/calc-2.13.0.1/help/base 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.14.0.0/help/base 2021-09-07 01:57:28.000000000 +0200 @@ -44,6 +44,9 @@ "sci" "exp" + 1000 "engineering" base 10 notation with exponent + "eng" multiple of 3 + For convenience, any non-integer value is assumed to mean base 10 fractions and any integer >= 2^64 is assumed to mean base 10 scientific notation. @@ -76,7 +79,7 @@ int math_setmode(int newmode) NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT, - MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY + MODE_REAL, MODE_EXP, MODE_ENG, MODE_HEX, MODE_OCTAL, MODE_BINARY SEE ALSO base2, config, str diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/help/base2 new/calc-2.14.0.0/help/base2 --- old/calc-2.13.0.1/help/base2 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.14.0.0/help/base2 2021-09-07 01:57:28.000000000 +0200 @@ -50,6 +50,9 @@ "sci" "exp" + 1000 "engineering" base 10 notation with exponent + "eng" multiple of 3 + 0 "off" disable double base output For convenience, any non-integer non-zero value is assumed to mean @@ -87,7 +90,7 @@ int math_setmode2(int newmode) NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT, - MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY, + MODE_REAL, MODE_EXP, MODE_ENG, MODE_HEX, MODE_OCTAL, MODE_BINARY, MODE2_OFF SEE ALSO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/help/config new/calc-2.14.0.0/help/config --- old/calc-2.13.0.1/help/config 2021-02-13 07:20:23.000000000 +0100 +++ new/calc-2.14.0.0/help/config 2021-09-07 01:57:28.000000000 +0200 @@ -165,8 +165,8 @@ config("display", int) The "display" parameter specifies the maximum number of digits after - the decimal point to be printed in real or exponential mode in - normal unformatted printing (print, strprint, fprint) or in + the decimal point to be printed in real, exponential or engineering + mode in normal unformatted printing (print, strprint, fprint) or in formatted printing (printf, strprintf, fprintf) when precision is not specified. The initial value for oldstd is 20, for newstd 10. The parameter may be changed to the value d by either @@ -234,6 +234,9 @@ "sci" "exp" + "engineering" base 10 notation with exponent base(10e6) + "eng" multiple of 3 + Where multiple strings are given, the first string listed is what config("mode") will return. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/qio.c new/calc-2.14.0.0/qio.c --- old/calc-2.13.0.1/qio.c 2021-03-08 19:58:40.000000000 +0100 +++ new/calc-2.14.0.0/qio.c 2021-09-07 01:57:28.000000000 +0200 @@ -247,6 +247,37 @@ PRINTF1("e%ld", exp); break; + case MODE_ENG: + if (qiszero(q)) { + PUTCHAR('0'); + return; + } + tmpval = *q; + tmpval.num.sign = 0; + exp = qilog10(&tmpval); + if (exp == 0) { /* in range to output as real */ + qprintnum(q, MODE_REAL, outdigits); + return; + } + tmpval.num = _one_; + tmpval.den = _one_; + if (exp > 0) { + exp -= exp % 3; + ztenpow(exp, &tmpval.den); + } else { + long remainder = exp % 3; + if (remainder) + exp -= remainder + 3; + ztenpow(-exp, &tmpval.num); + } + q = qmul(q, &tmpval); + zfree(tmpval.num); + zfree(tmpval.den); + qprintnum(q, MODE_REAL, outdigits); + qfree(q); + if (exp) PRINTF1("e%ld", exp); + break; + case MODE_REAL_AUTO: { const int P = conf->outdigits ? conf->outdigits : 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/version.c new/calc-2.14.0.0/version.c --- old/calc-2.13.0.1/version.c 2021-04-09 21:28:44.000000000 +0200 +++ new/calc-2.14.0.0/version.c 2021-09-07 04:27:35.000000000 +0200 @@ -52,9 +52,9 @@ #define MAJOR_VER 2 /* major library version */ -#define MINOR_VER 13 /* minor library version */ +#define MINOR_VER 14 /* minor library version */ #define MAJOR_PATCH 0 /* major software version level */ -#define MINOR_PATCH 1 /* minor software version level */ +#define MINOR_PATCH 0 /* minor software version level */ /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/win32/conf.h new/calc-2.14.0.0/win32/conf.h --- old/calc-2.13.0.1/win32/conf.h 2021-04-17 08:54:02.000000000 +0200 +++ new/calc-2.14.0.0/win32/conf.h 2021-09-07 08:27:16.000000000 +0200 @@ -14,7 +14,7 @@ /* the default :-separated startup file list */ #if !defined(DEFAULTCALCRC) -#define DEFAULTCALCRC "/lib/calc/startup:~/.calcrc:./.calcinit" +#define DEFAULTCALCRC "./.calcinit:~/.calcrc:/lib/calc/startup" #endif /* DEFAULTCALCRC */ /* the location of the help directory */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/win32.mkdef new/calc-2.14.0.0/win32.mkdef --- old/calc-2.13.0.1/win32.mkdef 2021-03-27 13:39:24.000000000 +0100 +++ new/calc-2.14.0.0/win32.mkdef 2021-09-07 01:37:15.000000000 +0200 @@ -49,7 +49,7 @@ MANMAKE= MANMODE= CALCPATH=./cal -CALCRC='/lib/calc/startup:~/.calcrc:./.calcinit' +CALCRC='./.calcinit:~/.calcrc:/lib/calc/startup' USE_READLINE=-DUSE_READLINE READLINE_LIB= READLINE_INCLUDE= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.13.0.1/zmath.h new/calc-2.14.0.0/zmath.h --- old/calc-2.13.0.1/zmath.h 2021-03-08 19:58:40.000000000 +0100 +++ new/calc-2.14.0.0/zmath.h 2021-09-07 01:57:28.000000000 +0200 @@ -594,7 +594,8 @@ #define MODE_OCTAL 6 #define MODE_BINARY 7 #define MODE_REAL_AUTO 8 -#define MODE_MAX 8 +#define MODE_ENG 9 +#define MODE_MAX 9 #define MODE2_OFF (MODE_MAX+1) /* XXX - perhaps we need the MODE_REAL_AUTO vs MODE_REAL as a config mode? */
