[Bug 221869] bc doesn't always convert ibase to obase correctly
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Aug 29 14:58:36 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221869
Conrad Meyer <cem at freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|New |Closed
CC| |cem at freebsd.org
Resolution|--- |Not A Bug
--- Comment #1 from Conrad Meyer <cem at freebsd.org> ---
Note that as soon as you set ibase=2, numbers are input in base 2. obase=10
assigns 0b10 (== decimal 2) to obase. You want obase=1010, or assign obase
before changing ibase. I believe this is identical in GNU bc.
$ bc (GNU)
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
ibase=2
obase=1010
1111
15
$ /usr/bin/bc (BSD)
ibase=2
obase=1010
1111
15
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list