]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
dc(1): fix modulo operations with fractional inputs
authorasomers <asomers@FreeBSD.org>
Thu, 7 Dec 2017 02:08:55 +0000 (02:08 +0000)
committerasomers <asomers@FreeBSD.org>
Thu, 7 Dec 2017 02:08:55 +0000 (02:08 +0000)
commitb86ceaa3ae76a50f9e432b6d7121ec5f20950171
tree91449b5bc84b91867178b26961eceac897e96c16
parent782597315d7ceb7b3ad7b8421b698f8fb47da3a7
dc(1): fix modulo operations with fractional inputs

Our dc(1) has never correctly calculated remainders with fractional inputs.
Both bmod and bdivmod seem to have copy/pasted code from bdiv, which results
in the remainder having the wrong output scale.

PR: 162495
Reported by: anonymous
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D13390
usr.bin/dc/bcode.c
usr.bin/dc/dc.1
usr.bin/dc/tests/Makefile
usr.bin/dc/tests/bcode.sh [new file with mode: 0755]
usr.bin/dc/tests/inout.sh