[haiku-commits] Re: r43199 - in haiku/trunk/src: apps/deskcalc kits/shared

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 11 Nov 2011 13:59:29 -0500

>>>> Add a scientific mode to Deskcalc.
>>>
>>> What I would find even more useful would be proper support of
>>> hexadecimal numbers (or even support any radix).

For the time being you can use BDH Calc

http://haikuware.com/directory/view-details/science-math/calculators/bdh-calc

to do hex, binary, and decimal bitwise operations and conversions.

Unfortunately it is not easy to do bit-level operations and
conversions in DeskCalc for 2 reasons.

First, DeskCalc uses MAPM numbers internally which are variable length
arbitrary precision numbers. This doesn't really work with binary and
hex very well or doing bitwise operations but it works great for doing
mathematical calculations.

Secondly, the parser interprets e and E to mean Euler's number and
x10^ respectively so we'd have to change the parsing to interpret 0xe
and 0xE as decimal 13.

Also do we support floating point or just integers (or rather
(u)int32s or (u)int64s)?

To support a "Computer Mode" we'd have to create a new parser that
works with hex and octal and binary (and maybe other bases) that
performs bitwise operations on (u)int(32|64)s instead of MAPMs.

Basically we have to switch the arithmetic that Deskcalc uses from
high school arithmetic to computer arithmetic when in "Computer mode".

John Scipione

Other related posts: