mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
usr/lib/byobu/.shutil: fix rounding error in fpdiv
Previously: $ fpdiv 119 100 1 1.1 Now: $ fpdiv 119 100 1 1.2
This commit is contained in:
parent
8033b4cb4c
commit
f833b191ed
2 changed files with 5 additions and 2 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -16,7 +16,10 @@ byobu (4.42) unreleased; urgency=low
|
||||||
* usr/lib/byobu/.constants, usr/lib/byobu/network:
|
* usr/lib/byobu/.constants, usr/lib/byobu/network:
|
||||||
- save a few more chars, drop the "ps" per second
|
- save a few more chars, drop the "ps" per second
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 14 Oct 2011 14:53:51 -0500
|
[Scott Moser]
|
||||||
|
* usr/lib/byobu/.shutil: fix rounding error in fpdiv
|
||||||
|
|
||||||
|
-- Scott Moser <smoser@brickies> Fri, 21 Oct 2011 13:31:59 -0400
|
||||||
|
|
||||||
byobu (4.41-0ubuntu1) precise; urgency=low
|
byobu (4.41-0ubuntu1) precise; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ fpdiv() {
|
||||||
n=$(((${mp}*${a})/${b}))
|
n=$(((${mp}*${a})/${b}))
|
||||||
|
|
||||||
# round up if necessary
|
# round up if necessary
|
||||||
[ $(($n%${mp})) -ge $((${mp}/2)) ] && n=$(($n+5))
|
[ $((($n-5)/10)) = $(($n/10)) ] && n=$(($n+5))
|
||||||
|
|
||||||
# drop the last digit, which was only there for rounding
|
# drop the last digit, which was only there for rounding
|
||||||
n=${n%?}
|
n=${n%?}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue