SVNews r326556

NOTE: This service is experimental and subject to change! Use at your own risk!

2017-12-05 04:22:35 - r326556 by asomers (asomers)

Complete list of files affected by revision r326556:

(Note: At the moment, these links point to ViewVC on svn.freebsd.org. They are probably slow. Do not overuse.)

  History   Contents   Diff   MODIFY   /head/etc/mtree/BSD.tests.dist  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/Makefile  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/bcode.c  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/bcode.h  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/extern.h  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/inout.c  
  History   Contents   Diff   MODIFY   /head/usr.bin/dc/mem.c  
   Contents     ADD   /head/usr.bin/dc/tests  
  History   Contents     ADD   /head/usr.bin/dc/tests/Makefile  
  History   Contents     ADD   /head/usr.bin/dc/tests/inout.sh  

Commit message:

dc(1): fix input of non-decimal fractional numbers

Inputting fractional non-decimal numbers has never worked correctly in our
OpenBSD-derived dc(1). It truncates the input to a number of decimal places
equal to the number of hexadecimal (or whatever base) places given on the
input. That's unacceptable, because many numbers require more precision to
represent in base 10 than in their original bases.

Fix this bug by using as many decimal places as needed to represent the
input, up to the maximum of the global scale factor.

This has one mildly surprising side effect: the scale of a number entered in
non-decimal mode will no longer necessarily equal the number of hexadecimal
(or whatever base) places given on the input. I think that's an acceptable
behavior change, given that inputting fractional non-decimal numbers never
worked in the first place, and the man page doesn't specify whether trailing
zeros on the input should affect a number's scale.

PR: 206230
Reported by: nibbana@gmx.us
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D13336

 


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 8 ms, 10 files printed. Current time is 2017-12-17 21:26:37. All times are in UTC/GMT.