Hello community, here is the log from the commit of package calc for openSUSE:Factory checked in at 2018-11-06 14:38:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/calc (Old) and /work/SRC/openSUSE:Factory/.calc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "calc" Tue Nov 6 14:38:52 2018 rev:18 rq:646389 version:2.12.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/calc/calc.changes 2018-10-18 15:39:42.954066561 +0200 +++ /work/SRC/openSUSE:Factory/.calc.new/calc.changes 2018-11-06 14:39:34.448579221 +0100 @@ -1,0 +2,16 @@ +Mon Nov 5 08:11:58 UTC 2018 - [email protected] + +- new stable release 2.12.7.0 + + The qprintnum() function now takes outdigits as a [optional] 3rd + argument. + + enhanced printf + + various documentation updates + + various fixes of build + +------------------------------------------------------------------- +Sat Oct 20 05:44:25 UTC 2018 - [email protected] + +- update to 2.12.6.10 + + minor improvements + +------------------------------------------------------------------- Old: ---- calc-2.12.6.9.tar.bz2 New: ---- calc-2.12.7.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ calc.spec ++++++ --- /var/tmp/diff_new_pack.usq4DR/_old 2018-11-06 14:39:35.800577178 +0100 +++ /var/tmp/diff_new_pack.usq4DR/_new 2018-11-06 14:39:35.804577172 +0100 @@ -19,7 +19,7 @@ %define soname 2 %define libname libcalc%{soname} Name: calc -Version: 2.12.6.9 +Version: 2.12.7.0 Release: 0 Summary: C-style arbitrary precision calculator License: LGPL-2.1 ++++++ calc-2.12.6.9.tar.bz2 -> calc-2.12.7.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/CHANGES new/calc-2.12.7.0/CHANGES --- old/calc-2.12.6.9/CHANGES 2018-10-16 04:36:43.000000000 +0200 +++ new/calc-2.12.7.0/CHANGES 2018-11-05 01:55:45.000000000 +0100 @@ -1,4 +1,44 @@ -The following are the changes from calc version 2.12.6.9 to date: +The following are the changes from calc version 2.12.7.0 to date: + + Added a patch to replaces the manual search for include files + in $(INCDIR) in the have_*.h targets with compiler invocations. + Thanks goes to Helmut Grohne (helmut at subdivi dot de) who + implemented the patch and posted it to the Debian bug tracker + and Martin Buck (m at rtin-buck dor de) for forwarding it to us. + + The check_include make rule was fixed to not assume /usr/include. + + The qprintnum() function now takes outdigits as a 3rd argument. + Most of the time, this 3rd argument is just conf->outdigits. + But when it comes to the experimental '%g', this value can + change. This avoids having to modify conf->outdigits. + + Fixed a problem where gcc complains about E_FUNC not being defined + for Linux systems as reported by Martin Buck (m at rtin-buck dor de). + + Updated the help files help/config, help/display, help/epsilon, + help/fprint, help/printf, and help/strprintf to give more + examples of how display digits and epsilon precision interact + with displaying values. + + Added more information about %g in the help file help/printf. + + The '\a' is now recognized in a printf format string as the + single byte audible bell character (byte 0x07 in ASCII encoding). + + The following is a partial list of escape sequences recognized + in strings and in printf formats: + + \a audible bell byte 0x07 in ASCII encoding + \b backspace byte 0x08 in ASCII encoding + \f form feed byte 0x0c in ASCII encoding + \n newline byte 0x0b in ASCII encoding + \r return byte 0x0a in ASCII encoding + \t tab byte 0x0d in ASCII encoding + \v vertical tab byte 0x09 in ASCII encoding + + +The following are the changes from calc version 2.12.6.9 to 2.12.6.9: Fixed a number of core dump bugs related to the calculation of tan(), cot(), sec(), csc(), tanh(), coth(), sech(), and csch(), @@ -26,8 +66,9 @@ INCDIR= $(shell xcrun --show-sdk-path --sdk macosx)/usr/include to determine the upper path of the /usr/include directory for macOS. - The Darwin target seems to not automatically detected. For now, - under macOS, declare the target as darwin: + In some rare cases, the Darwin target seems to not automatically detected. + If you are running under macOS, and that happens, you can force + the target to be Darwin: # for macOS users only, force the target to be darwin # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/Makefile new/calc-2.12.7.0/Makefile --- old/calc-2.12.6.9/Makefile 2018-10-16 03:45:05.000000000 +0200 +++ new/calc-2.12.7.0/Makefile 2018-11-05 00:43:59.000000000 +0100 @@ -1054,7 +1054,7 @@ # The default calc versions # -VERSION= 2.12.6.9 +VERSION= 2.12.7.0 # Names of shared libraries with versions # @@ -2179,25 +2179,15 @@ all: check_include ${BLD_TYPE} CHANGES check_include: - $(Q) if [ ! -d ${INCDIR} ]; then \ - echo "ERROR: critical directory missing: /usr/include" 1>&2; \ - echo "Without this critical directory, we cannot compile." 1>&2; \ - echo 1>&2; \ + $(Q) if ! echo '#include <stdio.h>' | ${CC} -E - >/dev/null 2>&1; then \ + echo "ERROR: Missing critical <stdio.h> include file." 1>&2; \ + echo "Without critical include files, we cannot compile." 1>&2; \ echo "Perhaps your system isn't setup to compile C source?" 1>&2; \ - echo "For example, Apple OS X / darwin requres that XCode" 1>&2; \ - echo "must be installed and that you run the command:" 1>&2; \ echo 1>&2; \ - echo " xcode-select --install" 1>&2; \ + echo "For example, Apple macOS / Darwin requres that XCode" 1>&2; \ + echo "must be installed." 1>&2; \ echo 1>&2; \ - exit 1; \ - fi - $(Q) if [ ! -f ${INCDIR}/stdio.h ]; then \ - echo "ERROR: critical include files are missing" 1>&2; \ - echo "Without this critical directory, we cannot compile." 1>&2; \ - echo 1>&2; \ - echo "Perhaps your system isn't setup to compile C source?" 1>&2; \ - echo "For example, Apple OS X / darwin requres that XCode" 1>&2; \ - echo "must be installed and that you run the command:" 1>&2; \ + echo "Also macOS users might later to run this command:" 1>&2; \ echo 1>&2; \ echo " xcode-select --install" 1>&2; \ echo 1>&2; \ @@ -2477,22 +2467,15 @@ ${Q} echo '' >> endian_calc.h ${Q} echo '/* what byte order are we? */' >> endian_calc.h -${Q} if [ X"${CALC_BYTE_ORDER}" = X ]; then \ - if [ -f ${INCDIR}/endian.h ]; then \ - echo '#include <endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f ${INCDIR}/machine/endian.h ]; then \ - echo '#include <machine/endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f ${INCDIR}/sys/endian.h ]; then \ - echo '#include <sys/endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/endian.h ]; then \ + if echo '#include <endian.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#include <endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/machine/endian.h ]; then \ + elif echo '#include <machine/endian.h>' | \ + ${CC} -E - >/dev/null 2>&1; then \ echo '#include <machine/endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/sys/endian.h ]; then \ + elif echo '#include <sys/endian.h>' | \ + ${CC} -E- >/dev/null 2>&1; then \ echo '#include <sys/endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ else \ @@ -2559,9 +2542,7 @@ echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_TIMES_H}" = X"NO" ]; then \ echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/times.h ]; then \ - echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/times.h ]; then \ + elif echo '#include <times.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ @@ -2570,9 +2551,7 @@ echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_SYS_TIMES_H}" = X"NO" ]; then \ echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/sys/times.h ]; then \ - echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/sys/times.h ]; then \ + elif echo '#include <sys/times.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ @@ -2581,9 +2560,7 @@ echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_TIME_H}" = X"NO" ]; then \ echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/time.h ]; then \ - echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/time.h ]; then \ + elif echo '#include <time.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ @@ -2592,9 +2569,7 @@ echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_SYS_TIME_H}" = X"NO" ]; then \ echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/sys/time.h ]; then \ - echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/sys/time.h ]; then \ + elif echo '#include <sys/time.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ @@ -2630,9 +2605,7 @@ echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ elif [ X"${HAVE_STDLIB_H}" = X"NO" ]; then \ echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ - elif [ -f ${INCDIR}/stdlib.h ]; then \ - echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ - elif [ -f /usr/include/stdlib.h ]; then \ + elif echo '#include <stdlib.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ else \ echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ @@ -2668,9 +2641,7 @@ echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ elif [ X"${HAVE_UNISTD_H}" = X"NO" ]; then \ echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ - elif [ -f ${INCDIR}/unistd.h ]; then \ - echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ - elif [ -f /usr/include/unistd.h ]; then \ + elif echo '#include <unistd.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ else \ echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ @@ -2706,9 +2677,7 @@ echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ elif [ X"${HAVE_STRING_H}" = X"NO" ]; then \ echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ - elif [ -f ${INCDIR}/string.h ]; then \ - echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ - elif [ -f /usr/include/string.h ]; then \ + elif echo '#include <string.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ else \ echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ @@ -2748,22 +2717,12 @@ echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f ${INCDIR}/termios.h ]; then \ - echo '/* use termios */' >> terminal.h; \ - echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \ - echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ - echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f ${INCDIR}/termio.h ]; then \ - echo '/* use termio */' >> terminal.h; \ - echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ - echo '#define USE_TERMIO /* <termio.h> */' >> terminal.h; \ - echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f /usr/include/termios.h ]; then \ + elif echo '#include <termios.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '/* use termios */' >> terminal.h; \ echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f /usr/include/termio.h ]; then \ + elif echo '#include <termio.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '/* use termio */' >> terminal.h; \ echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#define USE_TERMIO /* <termio.h> */' >> terminal.h; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/Makefile.simple new/calc-2.12.7.0/Makefile.simple --- old/calc-2.12.6.9/Makefile.simple 2018-10-16 04:40:28.000000000 +0200 +++ new/calc-2.12.7.0/Makefile.simple 2018-11-05 02:29:38.000000000 +0100 @@ -981,7 +981,7 @@ # The default calc versions # -VERSION= 2.12.6.9 +VERSION= 2.12.7.0 # Names of shared libraries with versions # @@ -1911,25 +1911,15 @@ all: check_include ${BLD_TYPE} CHANGES check_include: - $(Q) if [ ! -d ${INCDIR} ]; then \ - echo "ERROR: critical directory missing: /usr/include" 1>&2; \ - echo "Without this critical directory, we cannot compile." 1>&2; \ - echo 1>&2; \ + $(Q) if ! echo '#include <stdio.h>' | ${CC} -E - >/dev/null 2>&1; then \ + echo "ERROR: Missing critical <stdio.h> include file." 1>&2; \ + echo "Without critical include files, we cannot compile." 1>&2; \ echo "Perhaps your system isn't setup to compile C source?" 1>&2; \ - echo "For example, Apple OS X / darwin requres that XCode" 1>&2; \ - echo "must be installed and that you run the command:" 1>&2; \ echo 1>&2; \ - echo " xcode-select --install" 1>&2; \ + echo "For example, Apple macOS / Darwin requres that XCode" 1>&2; \ + echo "must be installed." 1>&2; \ echo 1>&2; \ - exit 1; \ - fi - $(Q) if [ ! -f ${INCDIR}/stdio.h ]; then \ - echo "ERROR: critical include files are missing" 1>&2; \ - echo "Without this critical directory, we cannot compile." 1>&2; \ - echo 1>&2; \ - echo "Perhaps your system isn't setup to compile C source?" 1>&2; \ - echo "For example, Apple OS X / darwin requres that XCode" 1>&2; \ - echo "must be installed and that you run the command:" 1>&2; \ + echo "Also macOS users might later to run this command:" 1>&2; \ echo 1>&2; \ echo " xcode-select --install" 1>&2; \ echo 1>&2; \ @@ -2187,22 +2177,15 @@ ${Q} echo '' >> endian_calc.h ${Q} echo '/* what byte order are we? */' >> endian_calc.h -${Q} if [ X"${CALC_BYTE_ORDER}" = X ]; then \ - if [ -f ${INCDIR}/endian.h ]; then \ - echo '#include <endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f ${INCDIR}/machine/endian.h ]; then \ - echo '#include <machine/endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f ${INCDIR}/sys/endian.h ]; then \ - echo '#include <sys/endian.h>' >> endian_calc.h; \ - echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/endian.h ]; then \ + if echo '#include <endian.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#include <endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/machine/endian.h ]; then \ + elif echo '#include <machine/endian.h>' | \ + ${CC} -E - >/dev/null 2>&1; then \ echo '#include <machine/endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ - elif [ -f /usr/include/sys/endian.h ]; then \ + elif echo '#include <sys/endian.h>' | \ + ${CC} -E- >/dev/null 2>&1; then \ echo '#include <sys/endian.h>' >> endian_calc.h; \ echo '#define CALC_BYTE_ORDER BYTE_ORDER' >> endian_calc.h; \ else \ @@ -2269,9 +2252,7 @@ echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_TIMES_H}" = X"NO" ]; then \ echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/times.h ]; then \ - echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/times.h ]; then \ + elif echo '#include <times.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ @@ -2280,9 +2261,7 @@ echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_SYS_TIMES_H}" = X"NO" ]; then \ echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/sys/times.h ]; then \ - echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/sys/times.h ]; then \ + elif echo '#include <sys/times.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ @@ -2291,9 +2270,7 @@ echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_TIME_H}" = X"NO" ]; then \ echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/time.h ]; then \ - echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/time.h ]; then \ + elif echo '#include <time.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ @@ -2302,9 +2279,7 @@ echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ elif [ X"${HAVE_SYS_TIME_H}" = X"NO" ]; then \ echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ - elif [ -f ${INCDIR}/sys/time.h ]; then \ - echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ - elif [ -f /usr/include/sys/time.h ]; then \ + elif echo '#include <sys/time.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ @@ -2340,9 +2315,7 @@ echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ elif [ X"${HAVE_STDLIB_H}" = X"NO" ]; then \ echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ - elif [ -f ${INCDIR}/stdlib.h ]; then \ - echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ - elif [ -f /usr/include/stdlib.h ]; then \ + elif echo '#include <stdlib.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ else \ echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ @@ -2378,9 +2351,7 @@ echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ elif [ X"${HAVE_UNISTD_H}" = X"NO" ]; then \ echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ - elif [ -f ${INCDIR}/unistd.h ]; then \ - echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ - elif [ -f /usr/include/unistd.h ]; then \ + elif echo '#include <unistd.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ else \ echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ @@ -2416,9 +2387,7 @@ echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ elif [ X"${HAVE_STRING_H}" = X"NO" ]; then \ echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ - elif [ -f ${INCDIR}/string.h ]; then \ - echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ - elif [ -f /usr/include/string.h ]; then \ + elif echo '#include <string.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ else \ echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ @@ -2458,22 +2427,12 @@ echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f ${INCDIR}/termios.h ]; then \ - echo '/* use termios */' >> terminal.h; \ - echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \ - echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ - echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f ${INCDIR}/termio.h ]; then \ - echo '/* use termio */' >> terminal.h; \ - echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ - echo '#define USE_TERMIO /* <termio.h> */' >> terminal.h; \ - echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f /usr/include/termios.h ]; then \ + elif echo '#include <termios.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '/* use termios */' >> terminal.h; \ echo '#define USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#undef USE_TERMIO /* <termio.h> */' >> terminal.h; \ echo '#undef USE_SGTTY /* <sys/ioctl.h> */' >> terminal.h; \ - elif [ -f /usr/include/termio.h ]; then \ + elif echo '#include <termio.h>' | ${CC} -E - >/dev/null 2>&1; then \ echo '/* use termio */' >> terminal.h; \ echo '#undef USE_TERMIOS /* <termios.h> */' >> terminal.h; \ echo '#define USE_TERMIO /* <termio.h> */' >> terminal.h; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/comfunc.c new/calc-2.12.7.0/comfunc.c --- old/calc-2.12.6.9/comfunc.c 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/comfunc.c 2018-10-19 03:45:38.000000000 +0200 @@ -1182,7 +1182,7 @@ return; } if (!qiszero(c->real) || qiszero(c->imag)) - qprintnum(c->real, MODE_DEFAULT); + qprintnum(c->real, MODE_DEFAULT, conf->outdigits); qtmp = c->imag[0]; if (qiszero(&qtmp)) return; @@ -1192,7 +1192,7 @@ math_chr('-'); qtmp.num.sign = 0; } - qprintnum(&qtmp, MODE_DEFAULT); + qprintnum(&qtmp, MODE_DEFAULT, conf->outdigits); math_chr('i'); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/custom/Makefile new/calc-2.12.7.0/custom/Makefile --- old/calc-2.12.6.9/custom/Makefile 2018-10-16 04:39:43.000000000 +0200 +++ new/calc-2.12.7.0/custom/Makefile 2018-11-05 02:28:51.000000000 +0100 @@ -348,7 +348,7 @@ # The default calc versions # -VERSION= 2.12.6.9 +VERSION= 2.12.7.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/custom/Makefile.head new/calc-2.12.7.0/custom/Makefile.head --- old/calc-2.12.6.9/custom/Makefile.head 2018-09-30 19:48:53.000000000 +0200 +++ new/calc-2.12.7.0/custom/Makefile.head 2018-11-05 00:43:59.000000000 +0100 @@ -348,7 +348,7 @@ # The default calc versions # -VERSION= 2.12.6.9 +VERSION= 2.12.7.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/custom/Makefile.simple new/calc-2.12.7.0/custom/Makefile.simple --- old/calc-2.12.6.9/custom/Makefile.simple 2018-10-16 04:40:28.000000000 +0200 +++ new/calc-2.12.7.0/custom/Makefile.simple 2018-11-05 02:29:38.000000000 +0100 @@ -333,7 +333,7 @@ # The default calc versions # -VERSION= 2.12.6.9 +VERSION= 2.12.7.0 # Names of shared libraries with versions # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/func.c new/calc-2.12.7.0/func.c --- old/calc-2.12.6.9/func.c 2018-09-30 22:31:39.000000000 +0200 +++ new/calc-2.12.7.0/func.c 2018-10-19 03:45:46.000000000 +0200 @@ -335,7 +335,7 @@ break; case V_NUM: math_divertio(); - qprintnum(vp->v_num, MODE_DEFAULT); + qprintnum(vp->v_num, MODE_DEFAULT, conf->outdigits); cp = math_getdivertedio(); result.v_str = makestring(cp); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/config new/calc-2.12.7.0/help/config --- old/calc-2.12.6.9/help/config 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/help/config 2018-11-05 01:56:32.000000000 +0100 @@ -949,6 +949,48 @@ ; display() 50 + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + + ; /* 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 + ; config("epsilon", 1e-10),; /* or epsilon(1e-10),; */ + ; printf("%f\n", pi()); + 3.1415926536 + + ; /* 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 + ; config("epsilon", 1e-72),; /* or epsilon(1e-72),; */ + ; printf("%f\n", pi()); + ~3.141592653590 + + ; /* 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 + ; config("epsilon", 1e-10),; /* or epsilon(1e-10),; */ + ; printf("%f\n", pi()); + 3.1415926536 + + /* NOTE: display has enough digits and epsilon is small enough */ + ; config("display", 72),; /* or display(72),; */ + ; printf("%f\n", pi(1e-72)); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + ; config("epsilon", 1e-72),; /* or epsilon(1e-72),; */ + ; printf("%f\n", pi()); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + LIMITS none @@ -956,9 +998,9 @@ n/a SEE ALSO - usage, custom, custom_cal, usage, epsilon, display + custom, custom_cal, display, epsilon, fprintf, printf, strprintf, usage -## Copyright (C) 1999-2007 Landon Curt Noll +## Copyright (C) 1999-2007,2018 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/display new/calc-2.12.7.0/help/display --- old/calc-2.12.6.9/help/display 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/help/display 2018-11-05 01:53:14.000000000 +0100 @@ -45,6 +45,48 @@ ; print display(5), 2/3 40 ~0.66667 + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + + ; /* NOTE: display has too few digits and epsilon is not small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + ; /* NOTE: display has too few digits yet epsilon is small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-72)); + ~3.141592653590 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + ~3.141592653590 + + ; /* NOTE: display has enough digits but epsilon is not small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + /* NOTE: display has enough digits and epsilon is small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-72)); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + LIMITS d >= 0 @@ -52,9 +94,9 @@ none SEE ALSO - config + config, epsilon, fprintf, printf, strprintf -## Copyright (C) 2004 Landon Curt Noll +## Copyright (C) 2004,2018 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/epsilon new/calc-2.12.7.0/help/epsilon --- old/calc-2.12.6.9/help/epsilon 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/help/epsilon 2018-11-05 01:52:03.000000000 +0100 @@ -16,13 +16,57 @@ and sets the stored epsilon value to eps. The stored epsilon value is used as default value for eps in - the functions appr(x, eps, rnd), sqrt(x, eps, rnd), etc. + many functions such as appr(x, eps, rnd), sqrt(x, eps, rnd), + pi(eps), sin(x, eps), tanh(x, eps), etc. 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 + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + + ; /* NOTE: display has too few digits and epsilon is not small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + ; /* NOTE: display has too few digits yet epsilon is small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-72)); + ~3.141592653590 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + ~3.141592653590 + + ; /* NOTE: display has enough digits but epsilon is not small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + /* NOTE: display has enough digits and epsilon is small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-72)); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + LIMITS none @@ -31,9 +75,9 @@ NUMBER *_epsilon_ SEE ALSO - config + config, display, fprintf, printf, strprintf -## Copyright (C) 1999 Landon Curt Noll +## Copyright (C) 1999,2018 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/fprintf new/calc-2.12.7.0/help/fprintf --- old/calc-2.12.6.9/help/fprintf 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/help/fprintf 2018-11-05 01:58:17.000000000 +0100 @@ -45,6 +45,48 @@ [2] = "undefined" [3] = NULL + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + + ; /* NOTE: display has too few digits and epsilon is not small enough */ + ; display(12),; + ; fprintf(files(1), "%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; fprintf(files(1), "%f\n", pi()); + 3.1415926536 + + ; /* NOTE: display has too few digits yet epsilon is small enough */ + ; display(12),; + ; fprintf(files(1), "%f\n", pi(1e-72)); + ~3.141592653590 + ; epsilon(1e-72),; + ; fprintf(files(1), "%f\n", pi()); + ~3.141592653590 + + ; /* NOTE: display has enough digits but epsilon is not small enough */ + ; display(72),; + ; fprintf(files(1), "%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; fprintf(files(1), "%f\n", pi()); + 3.1415926536 + + /* NOTE: display has enough digits and epsilon is small enough */ + ; display(72),; + ; fprintf(files(1), "%f\n", pi(1e-72)); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + ; epsilon(1e-72),; + ; fprintf(files(1), "%f\n", pi()); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + LIMITS The number of arguments of fprintf() is not to exceed 1024. @@ -52,9 +94,9 @@ none SEE ALSO - printf, strprintf, print + config, display, epsilon, printf, strprintf -## Copyright (C) 1999-2006 Landon Curt Noll +## Copyright (C) 1999-2006,2018 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/printf new/calc-2.12.7.0/help/printf --- old/calc-2.12.6.9/help/printf 2018-10-01 01:11:23.000000000 +0200 +++ new/calc-2.12.7.0/help/printf 2018-11-05 01:52:25.000000000 +0100 @@ -51,7 +51,7 @@ d, s, c current config("mode") f real (decimal, floating point) e exponential - g real or exponential depending on config("display") + g general format (real or exponential) r fractional o octal x hexadecimal @@ -63,15 +63,27 @@ if a positive width w has been specified, the effect is to produce w spaces, e.g., printf("abc%6dxyz") prints "abc xyz". + Control charters may be given in fmt by escaping them with + the \ character. The following control charter escape + sequences are recognized: + + \a audible bell byte 0x07 in ASCII encoding + \b backspace byte 0x08 in ASCII encoding + \f form feed byte 0x0c in ASCII encoding + \n newline byte 0x0b in ASCII encoding + \r return byte 0x0a in ASCII encoding + \t tab byte 0x0d in ASCII encoding + \v vertical tab byte 0x09 in ASCII encoding + If i <= the number of specifiers in fmt, the value of argument x_i is printed in the format specified by the i-th specifier. If a positive width w has been specified and normal printing of x_i does not include a '\n' character, what is printed will if necessary be padded with spaces so that the length of the printed output is at least the w. Note that control characters - like '\t', '\b' each count as one character. If the 'right-pad' - flag has been set, the padding is on the right; otherwise it - is on the left. + (e.g., '\a', '\b', '\f', '\n', '\r', '\t', '\n') count as one + character. If the 'right-pad' flag has been set, the padding + is on the right; otherwise it is on the left. If i > the number of specifiers in fmt, the value of argument x_i does not contribute to the printing. However, as all arguments @@ -84,22 +96,38 @@ specified precision will be ignored except for floating-point mode. - In the case of floating-point (f) format the precision determines - the maximum number of decimal places to be displayed. Other - aspects of this printing may be affected by the configuration - parameters "outround", "tilde", "fullzero", "leadzero". + The (g) general format will print the as real (f) (decimal or + floating point) or as an exponential (e) depending on the + configuration parameter "display". + + In the case of floating-point (f) format, and the (g) general + format, the precision determines the maximum number of decimal + places to be displayed. Other aspects of this printing may be + affected by the configuration parameters "outround", "tilde", + "fullzero", "leadzero". EXAMPLE - ; c = config("epsilon", 1e-6); c = config("display", 6); - ; c = config("tilde", 1); c = config("outround", 0); - ; c = config("fullzero", 0); + ; config("epsilon", 1e-6),; + : config("display", 6),; + ; config("tilde", 1),; + ; config("outround", 0),; + ; config("fullzero", 0),; ; fmt = "%f,%10f,%-10f,%10.4f,%.4f,%.f.\n"; ; a = sqrt(3); ; printf(fmt,a,a,a,a,a,a); 1.732051, 1.732051,1.732051 , ~1.7320,~1.7320,~1. - ; c = config("tilde", 0); c = config("outround",24); - ; c = config("fullzero", 1); + ; config("display", 5),; + : config("tilde", 0),; + ; printf("%f\n", pi()); + 3.1416 + ; config("display", 10),; + ; printf("%f\n", pi()); + 3.141592654 + + ; config("tilde", 0),; + : config("outround",24),; + ; config("fullzero", 1),; ; printf(fmt,a,a,a,a,a,a); 1.732051, 1.732051,1.732051 , 1.7321,1.7321,2. @@ -117,11 +145,82 @@ [2] = "undefined" [3] = NULL - ; c = config("display", 50); + ; config("display", 50),; ; printf("%g %g\n%g %g\n", 1e5, 1e49, 1e50, 1e500); 100000 100000000000000000000000000000000000000000000000000 1e50 1e500 + ; config("display", 10),; + : config("tilde", 0),; + ; printf("%f %f %f\n%f %f %f\n", + exp(1), exp(2), exp(3), exp(4), exp(5), exp(6)); + 2.7182818285 7.3890560989 20.0855369232 + 54.5981500331 148.4131591026 403.4287934927 + ; printf("%e %e %e\n%e %e %e\n", + exp(1), exp(2), exp(3), exp(4), exp(5), exp(6)); + 2.7182818285 7.3890560989 2.0085536923e1 + 5.4598150033e1 1.4841315910e2 4.0342879349e2 + ; printf("%g %g %g\n%g %g %g\n", + exp(1), exp(2), exp(3), exp(4), exp(5), exp(6)); + 2.718281828 7.389056099 20.08553692 + 54.59815003 148.4131591 403.4287935 + + ; config("display", 10),; + ; config("tilde", 0),; + ; printf("%f %f %f\n%f %f %f\n", + exp(20), exp(21), exp(22), exp(23), exp(24), exp(25)); + 485165195.4097902780 1318815734.4832146972 3584912846.1315915617 + 9744803446.2489026000 26489122129.8434722941 72004899337.3858725242` + ; printf("%e %e %e\n%e %e %e\n", + exp(20), exp(21), exp(22), exp(23), exp(24), exp(25)); + 4.8516519541e8 1.3188157345e9 3.5849128461e9 + 9.7448034462e9 2.6489122130e10 7.2004899337e10 + ; printf("%g %g %g\n%g %g %g\n", + exp(20), exp(21), exp(22), exp(23), exp(24), exp(25)); + 485165195.4 1318815734 3584912846 + 9744803446 2.648912213e10 7.200489934e10 + + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + + ; /* NOTE: display has too few digits and epsilon is not small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + ; /* NOTE: display has too few digits yet epsilon is small enough */ + ; display(12),; + ; printf("%f\n", pi(1e-72)); + ~3.141592653590 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + ~3.141592653590 + + ; /* NOTE: display has enough digits but epsilon is not small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-10)); + 3.1415926536 + ; epsilon(1e-10),; + ; printf("%f\n", pi()); + 3.1415926536 + + /* NOTE: display has enough digits and epsilon is small enough */ + ; display(72),; + ; printf("%f\n", pi(1e-72)); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 + ; epsilon(1e-72),; + ; printf("%f\n", pi()); + 3.141592653589793238462643383279502884197169399375105820974944592307816406 LIMITS The number of arguments of printf() is not to exceed 1024. @@ -130,7 +229,7 @@ none SEE ALSO - fprintf, strprintf, print + config, display, epsilon, fprintf, strprintf ## Copyright (C) 1999-2006,2018 Landon Curt Noll ## diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/str new/calc-2.12.7.0/help/str --- old/calc-2.12.6.9/help/str 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/help/str 2018-11-05 00:43:04.000000000 +0100 @@ -37,7 +37,7 @@ LINK LIBRARY void math_divertio(); - qprintnum(NUMBER *x, int outmode); + qprintnum(NUMBER *x, int outmode, LEN outdigits); char *math_getdivertedio(); math_divertio(); @@ -47,7 +47,7 @@ SEE ALSO base, base2, config -## Copyright (C) 1999-2006 Landon Curt Noll +## Copyright (C) 1999-2006,2018 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/help/strprintf new/calc-2.12.7.0/help/strprintf --- old/calc-2.12.6.9/help/strprintf 2018-10-01 01:11:23.000000000 +0200 +++ new/calc-2.12.7.0/help/strprintf 2018-11-05 01:53:59.000000000 +0100 @@ -18,22 +18,68 @@ ; strprintf("h=%d, i=%d", 2, 3); "h=2, i=3" - ; c = config("epsilon", 1e-6); c = config("display", 6); - ; c = config("tilde", 1); c = config("outround", 0); - ; c = config("fullzero", 0); + ; config("epsilon", 1e-6),; + ; config("display", 6),; + ; config("tilde", 1),; + ; config("outround", 0),; + ; config("fullzero", 0),; ; fmt = "%f,%10f,%-10f,%10.4f,%.4f,%.f.\n"; ; a = sqrt(3); ; strprintf(fmt,a,a,a,a,a,a); "1.732051, 1.732051,1.732051 , ~1.7320,~1.7320,~1. " - ; c = config("display", 50); + ; config("display", 50),; ; fmt2 = "%g %g\n%g %g\n" ; strprintf(fmt2, 1e5, 1e49, 1e50, 1e500); "100000 100000000000000000000000000000000000000000000000000 1e50 1e500 " + ; /* + * NOTE: When displaying many digits after the decimal point + * be sure to set display(digits) (see 'help display') to + * large enough AND to set epsilon(eps) (see 'help epsilon') + * small enough (or if the function has a esp argument, + * give a eps argument that is small enough) to display + * the value correctly. + */ + ; config("tilde", 1),; + ; config("tab", 0),; + ; fmt1 = "%f"; + + ; /* NOTE: display has too few digits and epsilon is not small enough */ + ; display(12),; + ; strprintf(fmt1, pi(1e-10)); + "3.1415926536" + ; epsilon(1e-10),; + ; strprintf(fmt1, pi()); + "3.1415926536" + + ; /* NOTE: display has too few digits yet epsilon is small enough */ + ; display(12),; + ; strprintf(fmt1, pi(1e-72)); + "~3.141592653590" + ; epsilon(1e-72),; + ; strprintf(fmt1, pi()); + ~3.141592653590 + + ; /* NOTE: display has enough digits but epsilon is not small enough */ + ; display(72),; + ; strprintf(fmt1, pi(1e-10)); + "3.1415926536" + ; epsilon(1e-10),; + ; strprintf(fmt1, pi()); + "3.1415926536" + + /* NOTE: display has enough digits and epsilon is small enough */ + ; display(72),; + ; strprintf(fmt1, pi(1e-72)); + "3.141592653589793238462643383279502884197169399375105820974944592307816406" + ; epsilon(1e-72),; + ; strprintf(fmt1, pi()); + "3.141592653589793238462643383279502884197169399375105820974944592307816406" + LIMITS The number of arguments of strprintf() is not to exceed 1024. @@ -41,10 +87,9 @@ none SEE ALSO - strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos, - strscan, strscanf, substr, - - printf, fprintf, print + config, display, epsilon, fprintf, strcat, strcpy, strerror, + strlen, strncmp, strncpy, strpos, strscan, strscanf, substr, + printf ## Copyright (C) 1999-2006,2018 Landon Curt Noll ## diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/longbits.c new/calc-2.12.7.0/longbits.c --- old/calc-2.12.6.9/longbits.c 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/longbits.c 2018-11-04 22:59:22.000000000 +0100 @@ -92,12 +92,6 @@ # include <stdlib.h> #endif -#if defined(__linux) -# if !defined(isascii) - E_FUNC int isascii(int c); -# endif /* !isascii */ -#endif /* __linux */ - char *program; /* our name */ int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/qio.c new/calc-2.12.7.0/qio.c --- old/calc-2.12.6.9/qio.c 2018-10-16 03:49:56.000000000 +0200 +++ new/calc-2.12.7.0/qio.c 2018-11-05 01:16:39.000000000 +0100 @@ -62,12 +62,13 @@ if (ch == '\\') { ch = *fmt++; switch (ch) { + case 'a': ch = '\a'; break; + case 'b': ch = '\b'; break; + case 'f': ch = '\f'; break; case 'n': ch = '\n'; break; case 'r': ch = '\r'; break; case 't': ch = '\t'; break; - case 'f': ch = '\f'; break; case 'v': ch = '\v'; break; - case 'b': ch = '\b'; break; case 0: va_end(ap); return; @@ -183,7 +184,7 @@ * Integers are always printed as themselves. */ void -qprintnum(NUMBER *q, int outmode) +qprintnum(NUMBER *q, int outmode, LEN outdigits) { NUMBER tmpval; long prec, exp; @@ -202,13 +203,13 @@ case MODE_REAL: prec = qdecplaces(q); - if ((prec < 0) || (prec > conf->outdigits)) { + if ((prec < 0) || (prec > outdigits)) { if (conf->tilde_ok) PUTCHAR('~'); } if (conf->fullzero || (prec < 0) || - (prec > conf->outdigits)) - prec = conf->outdigits; + (prec > outdigits)) + prec = outdigits; qprintff(q, 0L, prec); break; @@ -225,7 +226,7 @@ tmpval.num.sign = 0; exp = qilog10(&tmpval); if (exp == 0) { /* in range to output as real */ - qprintnum(q, MODE_REAL); + qprintnum(q, MODE_REAL, outdigits); return; } tmpval.num = _one_; @@ -237,35 +238,22 @@ q = qmul(q, &tmpval); zfree(tmpval.num); zfree(tmpval.den); - qprintnum(q, MODE_REAL); + qprintnum(q, MODE_REAL, outdigits); qfree(q); PRINTF1("e%ld", exp); break; case MODE_REAL_AUTO: { - /* - * XXX - re-write to not modify conf->outdigits - * - * Modifying the configuration value could be dangerious - * when a calculation is aborted within an opcode. - * Better to use qprintfg() use inline code that - * does not depend on changing conf->outdigits. - */ const int P = conf->outdigits ? conf->outdigits : 1; - long olddigits; tmpval = *q; tmpval.num.sign = 0; exp = qilog10(&tmpval); - olddigits = conf->outdigits; if (P > exp && exp >= -P) { - conf->outdigits = P - 1 - exp; - qprintnum(q, MODE_REAL); + qprintnum(q, MODE_REAL, P - 1 - exp); } else { - conf->outdigits = P - 1; - qprintnum(q, MODE_EXP); + qprintnum(q, MODE_EXP, P - 1); } - conf->outdigits = olddigits; break; } @@ -288,7 +276,7 @@ if (outmode2 != MODE2_OFF) { PUTSTR(" /* "); - qprintnum(q, outmode2); + qprintnum(q, outmode2, outdigits); PUTSTR(" */"); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/qmath.h new/calc-2.12.7.0/qmath.h --- old/calc-2.12.6.9/qmath.h 2018-01-18 23:20:07.000000000 +0100 +++ new/calc-2.12.7.0/qmath.h 2018-10-19 03:22:01.000000000 +0200 @@ -67,7 +67,7 @@ E_FUNC SFULL qtos(NUMBER *q); E_FUNC long qparse(char *str, int flags); E_FUNC void qfreenum(NUMBER *q); -E_FUNC void qprintnum(NUMBER *q, int mode); +E_FUNC void qprintnum(NUMBER *q, int mode, LEN outdigits); E_FUNC void qprintff(NUMBER *q, long width, long precision); E_FUNC void qprintfe(NUMBER *q, long width, long precision); E_FUNC void qprintfr(NUMBER *q, long width, BOOL force); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/qmod.c new/calc-2.12.7.0/qmod.c --- old/calc-2.12.6.9/qmod.c 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/qmod.c 2018-10-19 03:46:52.000000000 +0200 @@ -404,7 +404,7 @@ for (i = 0, rcp = redc_cache; i < MAXREDC; i++, rcp++) { if (rcp->age > 0) { printf("%-8ld%-8ld", i, rcp->age); - qprintnum(rcp->rnum, 0); + qprintnum(rcp->rnum, 0, conf->outdigits); printf("\n"); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/str.c new/calc-2.12.7.0/str.c --- old/calc-2.12.6.9/str.c 2017-06-02 23:50:17.000000000 +0200 +++ new/calc-2.12.7.0/str.c 2018-11-05 02:04:05.000000000 +0100 @@ -1380,17 +1380,17 @@ math_chr('\\'); ech = 0; switch (ch) { + case '\a': ech = 'a'; break; + case '\b': ech = 'b'; break; + case '\f': ech = 'f'; break; case '\n': ech = 'n'; break; case '\r': ech = 'r'; break; case '\t': ech = 't'; break; - case '\b': ech = 'b'; break; - case '\f': ech = 'f'; break; case '\v': ech = 'v'; break; case '\\': ech = '\\'; break; case '\"': ech = '\"'; break; case '\'': ech = '\''; break; case 0: ech = '0'; break; - case 7: ech = 'a'; break; case 27: ech = 'e'; break; } if (ech == '0') { @@ -1438,8 +1438,17 @@ continue; n++; switch (ch) { - case '\n': case '\r': case '\t': case '\b': case '\f': - case '\v': case '\\': case '\"': case 7: case 27: + case '\a': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + case '\v': + case '\\': + case '\"': + case '\'': + case 27: continue; } if (ch >= 64 || (nch >= '0' && nch <= '7')) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/token.c new/calc-2.12.7.0/token.c --- old/calc-2.12.6.9/token.c 2018-09-30 18:35:11.000000000 +0200 +++ new/calc-2.12.7.0/token.c 2018-11-05 01:04:39.000000000 +0100 @@ -183,10 +183,12 @@ } switch (ch) { case ' ': - case '\t': + case '\a': + case '\b': + case '\f': case '\r': + case '\t': case '\v': - case '\f': case '\0': break; case '\n': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/value.c new/calc-2.12.7.0/value.c --- old/calc-2.12.6.9/value.c 2018-09-30 20:29:23.000000000 +0200 +++ new/calc-2.12.7.0/value.c 2018-10-19 03:47:04.000000000 +0200 @@ -2774,7 +2774,7 @@ } switch (type) { case V_NUM: - qprintnum(vp->v_num, MODE_DEFAULT); + qprintnum(vp->v_num, MODE_DEFAULT, conf->outdigits); if (conf->traceflags & TRACE_LINKS) math_fmt("#%ld", vp->v_num->links); break; @@ -2835,7 +2835,7 @@ if (userfunc("octet_print", vp)) break; qtemp = itoq((long) *vp->v_octet); - qprintnum(qtemp, MODE_DEFAULT); + qprintnum(qtemp, MODE_DEFAULT, conf->outdigits); qfree(qtemp); break; case V_OPTR: @@ -2888,7 +2888,7 @@ math_chr('"'); return; case V_NUM: - qprintnum(vp->v_num, MODE_FRAC); + qprintnum(vp->v_num, MODE_FRAC, conf->outdigits); return; case V_COM: mode = math_setmode(MODE_FRAC); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/calc-2.12.6.9/version.c new/calc-2.12.7.0/version.c --- old/calc-2.12.6.9/version.c 2018-09-30 19:46:41.000000000 +0200 +++ new/calc-2.12.7.0/version.c 2018-11-05 00:43:46.000000000 +0100 @@ -44,8 +44,8 @@ #define MAJOR_VER 2 /* major library version */ #define MINOR_VER 12 /* minor library version */ -#define MAJOR_PATCH 6 /* major software level under library version */ -#define MINOR_PATCH 9 /* minor software level or 0 if not patched */ +#define MAJOR_PATCH 7 /* major software level under library version */ +#define MINOR_PATCH 0 /* minor software level or 0 if not patched */ /* ++++++ checksum.sha-256 ++++++ --- /var/tmp/diff_new_pack.usq4DR/_old 2018-11-06 14:39:36.884575540 +0100 +++ /var/tmp/diff_new_pack.usq4DR/_new 2018-11-06 14:39:36.884575540 +0100 @@ -4,53 +4,18 @@ # # sha256sum filename # -753d90537c0cd0e99c68712b33bfd98ed7504e61b4259d81ba94ff783f86e84c calc-2.12.5.6-12.src.rpm -d67c376f4b32d33580a29eb8b3c52b5987a15269db010f09f5bed31d0fab230a calc-2.12.5.6-12.x86_64.rpm -76090203a96d35dd10103112a7ad612f4d9b0526b758f2f49ac5bef02ba7cb39 calc-2.12.5.6.tar.bz2 -9a852f17cce6b48367c0bf11c4d491374e18117b146e7384a9f16c6f85184a7d calc-2.12.6.0-12.src.rpm -bd7f6c3e102db3431a4e229c75509d6219ba48316aef115d52df9be7b847fc7b calc-2.12.6.0-12.x86_64.rpm -18dee9d979d8d397ee4a6f57c494a60790034c0ff109b3c552faff97f1ad7cf2 calc-2.12.6.0.tar.bz2 -2982a89257af8066e13fadacd9d6bb880efbb3d1f3506bc0ce5d3c2f5739447e calc-2.12.6.1-12.src.rpm -5efb924c6f34737af6c78d752ad37782943deca6e5ba1eb55598b7528a820642 calc-2.12.6.1-12.x86_64.rpm -6d3b9237b671e0970c432f5886d467c142b425c713ec3beffb6fd05b6195c4ef calc-2.12.6.1.tar.bz2 -e4cac89afb19621b8411c77618f470d3e293c8749bb05ecbc7d8858022d0fab9 calc-2.12.6.3-12.src.rpm -1df9a38bbb33e7d004d31caab28cc1f847c76d0902fd2fb79f7c541711054172 calc-2.12.6.3-12.x86_64.rpm -7e7eba580055e53e57cbe147e1955060b0374234ef9b3ec4f29f1cfd8b06a206 calc-2.12.6.3.tar.bz2 -a3a78424ed678ccc8082de460daa99c44d19d6e2552f488a31245eed1a532a35 calc-2.12.6.4-12.src.rpm -a252b277fb7f437ad454b5d4e1ad65f34d31fad7df7ed21380d7ccf72be9d979 calc-2.12.6.4-12.x86_64.rpm -bbe27ca48eb315c1785333fcecf0c1ebbdc8a255507b1bf42e3abc751458cb07 calc-2.12.6.4.tar.bz2 -9e911442d8bfd59e7ef956547945f4e12bcdb800e1bce285770e813a7fdd6bb5 calc-2.12.6.5-12.src.rpm -0d640aff8513d66fbe266b80cf165fd0bf4da5419dfc5556f7f73cb3b7df51c3 calc-2.12.6.5-12.x86_64.rpm -4e79a4e4615b92c1d8533e9ab4fdaca95715aaed45405c29daa886f8a1236733 calc-2.12.6.5.tar.bz2 -f3b39407a4dba9c2bb208214d49b7d3b4b35815f02f90cea0ffd2d343e67482c calc-2.12.6.6-12.src.rpm -e011921f5459bb03be02d8d93edbd225e8682a2794dad36884cdf3089784b229 calc-2.12.6.6-12.x86_64.rpm -a525c695039adc6bc925126664a40f9f22fe6b35c9312dd0cf1a1b1b610f4f0f calc-2.12.6.6.tar.bz2 -9df50741dc45a8233509c06c0545eeb59ac2efcb57a88bea87d6f8d3cbdcb460 calc-2.12.6.7-12.src.rpm -65a24d18e6f0e6a141904bf22c2da7f269314d45569288120a5eb8a2eceb1b4b calc-2.12.6.7-12.x86_64.rpm -3a4f1acde15941048214f393beb97f9e12fc1ef2585fe0ab026e93ebcd19dd46 calc-2.12.6.7.tar.bz2 -24b38ea23898bfcee6309d525aa09559d5d82aa93f26a6a5514669956142f953 calc-2.12.6.8-12.src.rpm -21662525a435df165ffc499206ffbeb54f1ccd36ffc69eba7261fda57bc0771c calc-2.12.6.8-12.x86_64.rpm -0b92d5c72d26759c2a65bf85de0c111fa9653d9e2756578639100e952fa88a90 calc-2.12.6.8.tar.bz2 +3e8045ad32c8b660f9bdc83ecaf005693dbc5cec2dd56c46b84438d2b431dc76 calc-2.12.6.10-12.src.rpm +923d2527727165c748c3eb9779fe627f3342fa96301291acd78bfdcae022d2a9 calc-2.12.6.10-12.x86_64.rpm +c861c402f7e5ac36bf1d082ae95f0a4a83ee8b46747bf1ab010e4cab148c20bf calc-2.12.6.10.tar.bz2 314b5eaf2edddd675860d3ff287e9b9256ae92cc99083d92a005a0ca11092d95 calc-2.12.6.9-12.src.rpm 28d0bdded7c61d9dea5592eaef459c76f49555f083b6b887754fbea507711a26 calc-2.12.6.9-12.x86_64.rpm 6ac100f9ccec40e20838023113ed86c3a0f10037e37b8168bbf85bc11d675313 calc-2.12.6.9.tar.bz2 -befb1ef348704f0c4c0a5ebf55b57acf6fa75119e3c8c267379814980ae70e83 calc-debuginfo-2.12.5.6-12.x86_64.rpm -83c7f2728496692f19bab7c957ba9867ed436f5048d595883831b7fdf9db0d31 calc-debuginfo-2.12.6.0-12.x86_64.rpm -e9aac5102f90ec81f8a3ec0d476d6cd89dc44f43823cff4f9415b10e076e8791 calc-debuginfo-2.12.6.1-12.x86_64.rpm -6a76d9c3fa42c2ccbbcfbc0c6f65f55abb8b7726846950618b291393d8139fd9 calc-debuginfo-2.12.6.3-12.x86_64.rpm -395945a90220f9e0e76b934bfb513e774c8fbda6ed180961c1febd9c1cf94cf6 calc-debuginfo-2.12.6.4-12.x86_64.rpm -eeeb978b5741573369d64e80f5d656b0fa69bfd477ed64535f8c77525af98e60 calc-debuginfo-2.12.6.5-12.x86_64.rpm -41a261ba48b8e1185cbceff6613fecfa5dde78bf2f92d8ffc7c85a4ffa0f6457 calc-debuginfo-2.12.6.6-12.x86_64.rpm -538c14d02ae94243ee678a93d92893df39d11ad317c28573d9a9710388b10e81 calc-debuginfo-2.12.6.7-12.x86_64.rpm -92e1c4d2426a3ec74abccd27b0745c1c73b452878250c5ff8868923ef5d06ce8 calc-debuginfo-2.12.6.8-12.x86_64.rpm +a52a53144d55fa6669ad81dd875dc1603e3df9a32a6354f0fdd6626390ec6ebe calc-2.12.7.0-12.src.rpm +3fc4cfd94a8a6ea08ac8a594a4c0679d9a0310d654bd8963080a07fd9767f8d8 calc-2.12.7.0-12.x86_64.rpm +4b48892e11adcd734db67ba135d916d29e0d07db1e32cb4a6e8b56e32e1895c2 calc-2.12.7.0.tar.bz2 +64be52e48955efb1b45055884c0059c764178b40a90689c1f46a560ce2039895 calc-debuginfo-2.12.6.10-12.x86_64.rpm 924b04b852a300b57fcda68271c58745d576ab3f4207e581c92b8037627518a7 calc-debuginfo-2.12.6.9-12.x86_64.rpm -91949fd27a789eab99817d93d1e4f12424948bb4910f0a23755cab5fed2fb658 calc-devel-2.12.5.6-12.x86_64.rpm -e79286c4b40913bdac87759dc5bf50b616af68c6fbda3c53c7703d66e311b9fa calc-devel-2.12.6.0-12.x86_64.rpm -97f16cf48b519285f6c8d10f64e56ac5aa4a50f7bfed82b57d2f711482c30930 calc-devel-2.12.6.1-12.x86_64.rpm -bc458c4bd50d5215ec2f6df01fb1f11e8270577f51c581d087fda42b68ebbcd3 calc-devel-2.12.6.3-12.x86_64.rpm -13e053525fcf8752a96ea306a3b7aa037a019afb224577916d7f7c9cee14a40c calc-devel-2.12.6.4-12.x86_64.rpm -79be5cb9df2f56cb4e90e2fe0d7936e4e1cada96c575beac9c9160917b2c87c4 calc-devel-2.12.6.5-12.x86_64.rpm -00ba5e70442ca62e3768ebb7b4cc22216c1c99c63f99b36faccf6aaafc751d50 calc-devel-2.12.6.6-12.x86_64.rpm -40f9a9bebcc71978579b1d5d8f75a8282e41fadbc43ede097f86ec51b6bb619a calc-devel-2.12.6.7-12.x86_64.rpm -bfa025a42ecaf9345b49f7f8059179ea0abc40091d2fde7d2090de877f86e18d calc-devel-2.12.6.8-12.x86_64.rpm +002b67677cecd2bcd7b982019c13f3ff1c568daea972c0b78153eda0f42f8b18 calc-debuginfo-2.12.7.0-12.x86_64.rpm +59cdab4780206ead34254de416ccd3b3c33a3e4dd0da34424faeac272a239bc9 calc-devel-2.12.6.10-12.x86_64.rpm a27915ff307df638eedb796ba7f121da2e2ed9eb6f7fc2288128eb611951ae5a calc-devel-2.12.6.9-12.x86_64.rpm +0e2442340f70be2e2e6650fcbb0f3d23454962b68e38eb2e6349be99412fbbeb calc-devel-2.12.7.0-12.x86_64.rpm
