Strange 'bc' behavior

A.SCHLAFLY andysc at houxv.UUCP
Sat May 3 01:55:04 AEST 1986


'bc' seems to have trouble retaining accuracy with base 16.  Try
the following example, done on a VAX 11/780 under UNIX V rel 2v2 (but
similar behavior found on other machines):

$ bc
ibase=16
obase=10
scale=30
x=0.3333
x
".332"
x*2
".665"
x*2.0000
".66594A"
x=.33330000
x
".3332FF"

Can anybody offer an explanation?  Thanks in advance.

                                          Andy Schlafly
                                          ...ihnp4!houxv!andysc



More information about the Comp.unix mailing list