OT: basic arithmetic functions
#1

Recently I purchased a new mobile phone (SAMSUNG SGH-C180) and as always I was curious about the features of the calculator. The manual was short with the description:

Quote:
Perform basic arithmetic functions.

Here's the menu:

*   .
# + - x / % ( )

Just an ordinary four-banger, I was thinking first. But then I realized it conforms to algebraic notation:

2+3*4 = 14
(2+3)*4 = 20

Up to 16 places can be displayed, however at most 6 places after the decimal point:

1000*1000*1000*1000*1000 = Out of range
1000*1000*1000*1000*1000-1 = 999999999999999
(1000*1000*1000*1000*1000*1000-1000)/1000 = 999999999999999
(1000*1000*1000*1000*1000-1)/1000 = 999999999999.999

355/113 = 3.141593
355000000000/113 = 3141592920.353982

1234567890+0.123456 = 1234567890.123456
12345678901+0.123456 = 12345678901.1235
123456789012+0.123456 = 123456789012.123

9876543210+0.123456 = 9876543210.123455
98765432109+0.123456 = 98765432109.1235
987654321098+0.123456 = 987654321098.123

Extracting the square root can be done iteratively
since you can edit the last computation:

(3/1+1)/2 = 2
(3/2+2)/2 = 1.75
(3/1.75+1.75)/2 = 1.732143
(3/1.732143+1.732143)/2 = 1.732051
(3/1.732051+1.732051)/2 = 1.732051

Error messages are nice:

1/0 = Can't divide by zero

But then I stumbled over the following:

23+17% = Syntax Error

Only after a while I found out how to use the percentage operation:

23%17 = 6
355%113 = 16

  • Who'd consider modulo a basic arithmetic function?
  • Have you ever noticed the use of % for this operation in a calculator? (I know it's common in many computer languages.)

Kind regards

Thomas

Edited: 10 Dec 2009, 8:54 p.m.

#2

im thinking the calculator in your phone is working in binary IEEE754 and compiled with the usual runtime mathlib.

you could check by calculating, say 1/17 and then multiplying and subtracting the significant figures. if it's binary, the numbers will go on and on and you will get garbage after 16 digits. if it's decimal, you will hit the zeros.

#3

First I was in doubt since e.g. 1/17*17-1 would just result in 0 as expected. Only after a while I came up with the following expression:

(1-(1000000-999999.999999)*1000000)*10000000000000

Using Python results in:

-76144933.700561523

While the calculator of my phone would yield:

-76144933.700562

I couldn't get any more places since the input field is limited to 50 characters.

So it seems intermediate results are calculated using binary while the result is rounded to 6 places after the decimal point.

Of course HP-calculators using BCD don't encounter problems with this expression.



Possibly Related Threads...
Thread Author Replies Views Last Post
  Layout of arithmetic keys on early calculators Walter B 10 912 11-20-2013, 11:13 AM
Last Post: Jake Schwartz
  [41CL] New Extra Functions version Monte Dalrymple 0 313 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  HP Prime: in need of help with defining functions Alberto Candel 14 1,274 10-27-2013, 10:48 AM
Last Post: Alberto Candel
  HP PRIME - Need help for basic program svp. dg1969 4 494 10-08-2013, 04:06 PM
Last Post: dg1969
  HP Prime spreadsheet functions SanS 0 685 10-04-2013, 04:23 AM
Last Post: SanS
  Stats functions on the HP34S Nicholas van Stigt 5 587 09-24-2013, 02:45 AM
Last Post: Nick_S
  Trig Functions Howard Owen 11 968 09-16-2013, 02:53 PM
Last Post: Fred Lusk
  50g piecewise functions Kurt Fankhauser 6 588 09-15-2013, 08:01 PM
Last Post: Kurt Fankhauser
  Missing functions on the HP Prime!!!??? :-( Namir 6 616 08-22-2013, 08:40 AM
Last Post: Gilles Carpentier
  HP41 Functions Address Table (F.A.T.) Antoine M. Couëtte 6 605 07-21-2013, 02:48 AM
Last Post: Antoine M. Couëtte

Forum Jump: