PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: Very low
[parent] calculator and CAS support for various positional bases (Example)

A typical basic calculator may do its computations in binary, but is usually only capable of displaying the results in decimal. Many (but not all) scientific calculators are capable of accepting input and showing output in binary, octal, decimal and hexadecimal, usually accessed with shifted keys (e.g., Shift-+ for binary, Shift-$ -$ for octal, Shift-$ \times$ for decimal, Shift-$ \div$ is one possible layout, such as on the Sharp EL-305V), less commonly by a mode change. A value displayed in one may be taken to another, subject to the following pretty-much-standard caveats:

a) Only integers are allowed in binary, octal and hexadecimal. For example, taking $ \pi$ to binary will change it to just plain 11. The calculator will usually ignore the fractional part, simply discarding it, though a few might round up if the fractional part is more than 0.5 or some arbitrary limit (the Windows Calculator 5.1 for Windows XP will change 3.9 to 3 in hexadecimal, but 3.999999999999999999999999999999 becomes 4 in hexadecimal).

b) Scientific notation is understandably unavailable in binary, but it's not available in octal or hexadecimal either. Therefore, the number must be less than $ b^{k - 1} - 1$, where $ k$ is the number of digits in the display (ignoring the two digits the exponent for scientic notation), usually 10 in most scientific calculators. This means the highest numbers that may be displayed in binary, octal and hexadecimal are usually 511, 134217727 and 68719476735, respectively. The Windows Calculator allows one to choose between byte, word, double word and quadruple word for display limit.

c) Negative numbers from decimal are converted to two's complement. So, for example, taking $ -1$ to hexadecimal with quadruple word size turns it to FFFFFFFFFFFFFFFF, which back to decimal is the Mersenne number 18446744073709551615.

In the Mac OS X Calculator, binary, octal and hexadecimal have been removed from the Scientific mode and shifted to the new Programmer mode. The limitation to positive integers still applies.

Computer algebra systems like Maple and Mathematica have more built-in support for various positional bases. For example, Mathematica can handle anything from binary to base 36, providing not only entry of operands and display of output in those bases, but also string manipulation (e.g., reinterpreting the vigesimal digits of a number backwards). Floating point values can be displayed in bases other than decimal (e.g., $ \pi \approx 3.243F6A888_{16}$). Negative numbers are displayed with negative signs, but two's complement is also available. If one needs support for other bases, it can be programmed, but of course one must make a decision about symbols.



"calculator and CAS support for various positional bases" is owned by PrimeFan.
(view preamble)

View style:

See Also: calculator, symbolic computation


This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: negative, point, string, base, bases, support, Mathematica, Maple, computer algebra systems, positive, Mac OS X Calculator, Mersenne number, size, complement, negative numbers, exponent, digits, number, scientific notation, Windows Calculator, limit, round up, fractional part, integers, mode, hexadecimal, scientific calculators, binary, calculator

This is version 1 of calculator and CAS support for various positional bases, born on 2007-04-11.
Object id is 9177, canonical name is CalculatorAndCASSupportForVariousPositionalBases.
Accessed 645 times total.

Classification:
AMS MSC11-01 (Number theory :: Instructional exposition )
 11A63 (Number theory :: Elementary number theory :: Radix representation; digital problems)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)