[lug] A simple hex calculator needed.....

Tkil tkil at scrye.com
Thu Jul 13 09:52:32 MDT 2000


`bc' and `dc' can both do this:

| $ bc
| bc 1.05
| Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
| This is free software with ABSOLUTELY NO WARRANTY.
| For details type `warranty'. 
| ibase=10 <RET>
| obase=16 <RET>
| 300 <RET>
| 12C
| 12+51 <RET>
| 3F

`dc' does it about the same way, although it uses RPN style math,
instead of infix style (which is what `bc' does):

| $ dc
| 10 i <RET>
| 16 o <RET>
| 300 p <RET>
| 12C
| 51 12 + p <RET>
| 3F

t.




More information about the LUG mailing list