[erlang-questions] computers doing maths
Tue Mar 19 05:12:57 CET 2019
I wish people wouldn't say "computers are binary"
as though this was true of all computers.
IBM 650: sign + 10 decimal digits in biquinary
IBM 1620: decimal arithmetic up to the size of store
IBM 360 and up: decimal arithmetic up to 31 digits
Burroughs Medium Systems (2500 to 4900): decimal
arithmetic with up to 100 decimal digits, this
included decimal floats with up to 100 mantissa
VAX: decimal string instructions
Some kind of decimal support for COBOL was actually
For that matter, ANSI Smalltalk includes
ScaledDecimal. Sadly, the ANSI standard
defers to the Language-Independent-Arithmetic
standard for the semantics of ScaledDecimal,
something about which LIA-1, LIA-2, and LIA-3
are by intention completely silent about, with
the result that there are some truly bizarre
implementations out there. Squeak is one of
them: it's ScaledDecimal numbers do decimal
*formatting* of rational numbers, which rather
misses the point:
1/3 asScaledDecimal: 1 ==> 0.3s1
0.3s1 * s ==> 0.9s1
(1/3 asScaledDecimal: 1) * 3 ==> 1.0s1
which is rather startling. And Pharo does the same.
On Tue, 19 Mar 2019 at 15:24, Peter J Etheridge <petergi@REDACTED>
> Dear Erlangers,
> If other novices enjoyed Bryan & RoK's recent discussion about decimals
> computed in binary machines as much as i did, you might find this 14:24
> clip interesting;
> it might be poorly titled, but the content is well presented.
> happy coding,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions