Anyone know a perl module for working with integers & fractions in
different bases, aside from the usual 2,8,10,16? Just integers would be
OK but ideally fractions too.

bc is confusing me, can anyone explain the last few calculations,

$ bc
ibase=8
obase=10
scale=4

1/2
.40000

1/4
.20000

1/.4
2.00000

/* here it gets weird for me */

0.1
.06

.1/5
.01217

1/5
.14631

quit
$

It appears to interpret integers based on ibase but not fractions.

Thanks,
Paul

-- 
Paul Makepeace ....................................... http://paulm.com/

"He's a one-legged amnesiac sorceror gone bad. She's a chain-smoking
 winged hooker with the soul of a mighty warrior. They fight crime!"
   -- http://paulm.com/toys/fight_crime.html

Reply via email to