Showing posts with label arithmetic. Show all posts
Showing posts with label arithmetic. Show all posts

Sunday, April 19, 2026

Spotlight: Casio Mini CM-605

Spotlight: Casio Mini CM-605









Quick Facts



Model: CM-605

Company: Casio

Type: Four Function

Power: 4 x AA

Case: Leather Case

Memory: No memory registers

Years in Production: Starting in 1974

Display: 6 digits

Operating Mode: Chain



Shout out to Monrovia Vintage in Monrovia, California.



A Display of Six Digits (with a Surprise)



The Casio Mini (CM-605) is a vintage calculator from 1974. The calculator has the four arithmetic functions (+, -, ×, ÷). Operations are carried out as they are entered.



The zeroes in the CM-605 are shown as small zeroes. Hence, 4000 would be shown as 4ooo.



One limitation is that we can only enter numbers up to six digits. If the number is less than 1, we can only enter 5 digits after the decimal point as the leading zero is inserted automatically.



But there is a secret. It turns out that Hewlett Packard isn’t the only one to have calculators with a SHOW function. This CM-605 has a show key, [ ►], when held, it will show up to six additional digits.



From the short time that I have worked with the CM-605:



* Integers and integer parts can be shown up to 12 significant digits.

* Fractional parts can be shown up to six significant digits.



I think I can best show the power of the show key [ ► ] by a few examples:



4 ÷ 7 ≈ 0.571428

Keystrokes: [ AC ] 4 [ ÷ ] 7 [ = ]

Display: o.57142 hold [ ► ] 8ooooo



4329 × 9277 = 40160133

Keystrokes: [ AC ] 4329 [ × ] 9277 [ = ]

Display: 4o16o1 hold [ ► ] 33.oooo



5.7 ÷ 4.95 ≈ 1.15151

Keystrokes: [ AC ] 5.7 [ ÷ ] 4.95 [ = ]

Display: 1.15151 hold [ ►] oooooo



0.975 × 6.37 ÷ 8 ≈ 0.776343

Keystrokes: [ AC ] 0.975 [ × ] 6.37 [ ÷ ] 8 [ = ]

Display: o.77634 hold [ ► ] 3ooooo



Because there is no square root function, here are some mathematical constants to five digits:



ln 2 ≈ 0.69315

π ≈ 3.14159

e ≈ 2.71828

√2 ≈ 1.41421

√3 ≈ 1.73205

√5 ≈ 2.23607



Final Thoughts



I love collecting calculators made in the 1970s, especially with classic LED digits. The six-display with the show button is unique for Casio calculators. This calculator is a great showpiece.




Source


“CASIO MINI-CM-605 (A)” Casio Ledudu. June 15, 2011. https://casio.ledudu.com/pockets.asp?type=872&lg=eng Retrieved March 31, 2026.



Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.



Saturday, November 9, 2024

TI-84 Plus CE Python: Drawing Bars

TI-84 Plus CE Python: Drawing Bars



My inspiration for this post was from a class I was taking at brilliant.org. A free plug: brillant.org is a great web service that offers easy to follow and interactive classes in mathematics, physics, and programming. Classes are offered at every level.



Introduction


The following set of scripts draw a set of bars. The blue bar is the base bar, while orange bars are added to the right of the base bar. The user specifies the length of the base (b) and orange bars, known as the increment (c). The length is in pixels. The screen is 320 pixels long.





Each of the scripts uses the TI-specific module TI-draw module. If you have another calculator or platform, another similar drawing module is needed. The scripts were typed on a TI-84 Plus CE Python Edition, but should work on the TI-83 Premium CE Python Edition and TI-Nspire CX II (I haven’t tested either).



BAR1: Static


This script asks the user for the length of the base bar, increment bar, and the number of bars.


Note that show_draw() command end the execution of the script with the drawing on the screen. Press [clear] to exit the screen.


# static bar


from ti_draw import *

print("Positive Integers Only")
b=int(input("base? "))
c=int(input("increment? "))
n=int(input("# of bars? "))

# total
t=b+c*n

# draw
clear()

# base
set_color(0,120,245)
fill_rect(0,80,b,40)

# increment
set_color(255,135,10)
for i in range(n):
  fill_rect(b+i*c,80,c,40)

# text
set_color(0,0,0)
draw_text(0,160,"Total: "+str(t)+" = "+str(b)+" + "+str(n)+" * "+str(c))
draw_text(0,180,"Press [clear] to exit.")

# draw
show_draw()


BAR2: Animate


This script asks the user for the length of the base bar, increment bar, and the number of bars. Only this time the drawing is animated as the number of increment bars is increased from 0 to n.


This script uses another module, time. This is needed for the sleep(s) command, where s is the number of seconds.



# animate bar


from ti_draw import *
from time import *

print("Positive Integers Only")
b=int(input("base? "))
c=int(input("increment? "))
n=int(input("# of bars? "))

# total
t=b+c*n

# range starts at 0
for i in range(n+1):
  clear()
  # base
  set_color(0,120,245)
  fill_rect(0,80,b,40)
  # increment
  set_color(255,135,10)
  for j in range(i):
    fill_rect(b+j*c,80,c,40)
  t=b+c*i
  # text
  set_color(0,0,0)
  draw_text(0,160,"Total: "+str(t)+" = "+str(b)+" +        "+str(n)+" * "+str(c))
  # draw
  sleep(0.5)

# for the screen to stay on the bars at the end
set_color(255,0,0)
draw_text(0,180,"Press [clear] to exit.")
show_draw()


BAR3: Control


Instead of giving a number of increment bars, the user controls the number of bars by pressing the right [ → ] and left [ ← ] keys. Exit by pressing the [ enter ] key.


This script uses the ti_system module. This allows for the wait_key() command, which stops execution until a key is pressed.


Key codes for TI-84 Plus CE Python and TI-83 CE Premium Python Edition:

[ → ]: right key, code 1

[ ← ]: left key, code 2

[ enter ]: enter key, code 5




# bar with get key

from ti_draw import *
from ti_system import *

def drawsub(b,c,n):
  # total
  t=b+c*n
  # draw
  clear()
  # base
  set_color(0,120,245)
  fill_rect(0,80,b,40)
  set_color(255,135,10)
  for i in range(n):
    fill_rect(b+i*c,80,c,40)
  set_color(0,0,0)
  draw_text(0,160,"Total: "+str(t)+" = "+str(b)+" +        "+str(n)+" * "+str(c))
  draw_text(0,180,"<- or ->, [enter] to quit")


print("Positive Integers Only")
b=int(input("base? "))
c=int(input("increment? "))
print("Press <- or ->")


# default value of n
n=0

# max number of incr
m=int((320-b)/c)

# key
k=0

while k!=5:
  k=wait_key()
  # left key
  if k==2 and n>0:
    n-=1
  # right key
  if k==1 and n<m:
    n+=1
  drawsub(b,c,n)

set_color(255,0,0)
draw_text(0,20,"DONE")
show_draw()



Download the scripts here: https://drive.google.com/file/d/1SKCXBm6lYi5cYurm7nqAqI-868lxvqpz/view?usp=sharing



Until next time and in good health,


Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


Saturday, May 11, 2024

Spotlight: Sharp EL-T100A

 Spotlight: Sharp EL-T100A




Quick Facts



Model: EL-T100A

Company: Sharp

Timeline: Late 2010s? (guess)

Type: Desktop, Quiz (Trainer)

Power: Solar, Battery back up CR2032






I purchased this EL-T100 at an estate sale in Glendora, California, for a dollar (along with paper). The EL-100T (and the later EL-100TA) is a “Brain Exerciser”, which is designed to test speed and accuracy on arithmetic math problems.


There are three modes for the EL-100A:


Regular desktop calculator. The display has 10 digits and has the arithmetic operator indicators. We can set and store the sales tax to use in future calculations. The keys are fast and responsive.


Quiz mode: Pressing the [ Quiz ] button to choose from a set of 25 problems, 50 problems, or 100 problems. We are given two results: the accuracy and the time it took to complete the quiz.


Age mode: Pressing the [ Age ] button will test you on 25 problems. In addition to accuracy time, your brain level is measured. After two attempts, which I took recently (March 24, 2024), I scored 98% correct in 1 minute, 26 seconds, with the age score of 42. The second time, I got 96% but in 1 minute, 17 seconds, with the age score of 40. I just turned 47 last March.


Key Summary


[ +TAX ] : Adds sales tax

Set tax rate: [ C CE ] [ C CE ] tax rate [ +TAX ]


[ -TAX ]: Subtracts sales tax

Verify tax rate: [ C CE ] [ C CE ] [ -TAX ]


[ R CM ]

Once: recalls the value in the memory register

Twice: clears the memory register (sets it as 0)


[ % ] {COR. %}

Math Mode: Perform a percentage calculation

Quiz/Age Mode: Verify the stored correct ratio of answers


[ × ] {DEL.}

Math Mode: multiplication

Quiz/Age Mode: erase stored, accumulated correct answers and percentage ratio


[ + ] {RES↑}

Math Mode: addition

Quiz/Age Mode: Display the completed duration values, oldest to newest problem


[ = ] {ENTER}

Math Mode: equals

Quiz/Age mode: start a drill or obtain an answer


[ - ] {RES↓}

Math Mode: subtraction

Quiz/Age Mode: Display the completed duration values, newest to oldest problem


[ ÷ ] {RANK}

Math Mode: division

Quiz/Age Mode: display the three fasted completed duration values of the quiz


[ CA ]

Clear all calculator memory except for tax rates. Terminates Quiz and Age mode.


[ M+ ]

Add the displayed value to the memory registers


Now I’m going to work on my fast arithmetic skills.


Source


“Sharp EL-T100AB” https://www.sharpusa.com/ForBusiness/SmallElectronics/CalculatorsNew/Models/ELT100AB.aspx Retrieved 29, 2024.


The Calculator Review “Review: Sharp EL-100AB “The Brian Exerciser”” February 27, 2019. https://www.calaquin.com/2019/02/review-sharp-el-t100ab-brain-exerciser.html Retrieved March 30, 2024.



Note: Both sources talk about an updated EL-T100AB, but it is said to share the same functionality of the EL-T100A.



Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Sunday, February 4, 2024

Some RPN Routines: Including Maximum and Minimum of Two Numbers

Some RPN Routines:  Including Maximum and Minimum of Two Numbers



Here are some RPN routines that hopefully you find helpful.   I am assuming that the values are stored in memory registers before calculation and a general four-level stack is used (HP 11C, 12C, 15C, 42S, 32S, 32SII, DM41X, DM32, DM42, DM15, WP34, etc.).  



(a + b + c) × (a + b - c)


Assume that: 

Memory register 1 = a

Memory register 2 = b

Memory register 3 = c

(Your memory registers may have different names or labels)



If recall arithmetic is allowed:


RCL 3

RCL 1

RCL+ 2

+

LST x

RCL- 3

×


(LST x = LAST x)


If recall arithmetic isn't available:


RCL 3

RCL 1

RCL 2

+

+

LST x

RCL 3

-

×



Example:  a= 10, b = 2, c = 7.   Result:  95



 (s + a) × (s + b) × (s + c)


Assume that: 

Memory register 1 = a

Memory register 2 = b

Memory register 3 = c

Memory register 4 = s

(Your memory registers may have different names or labels)


If recall arithmetic is allowed:


RCL 4

ENTER

ENTER

ENTER

RCL+ 1

x<>y

RCL+ 2

×

x<>y

RCL+ 3

×


If recall arithmetic isn't available:


RCL 4

ENTER

ENTER

ENTER

RCL 1

+

x<>y

RCL 2

+

×

x<>y

RCL 3

+

×


Example:  a = 4, b = 8, c = 2, s = 3.   Result:  385



 (s - a) × (s - b) × (s - c)


Assume that: 

Memory register 1 = a

Memory register 2 = b

Memory register 3 = c

Memory register 4 = s

(Your memory registers may have different names or labels)


If recall arithmetic is allowed:


RCL 4

ENTER

ENTER

ENTER

RCL- 1

x<>y

RCL- 2

×

x<>y

RCL- 3

×


If recall arithmetic isn't available:


RCL 4

ENTER

ENTER

ENTER

RCL 1

-

x<>y

RCL 2

-

×

x<>y

RCL 3

-

×


Example:  a = 8, b = 10, c = 3, s = 24.   Result:  4,704



The Maximum and Minimum of the X and Y Stacks



In a program, we can arrange the stack to show the maximum and minimum between two numbers as follows:



Maximum on the X Stack, Minimum on the Y Stack:


...

x≤y   

x<>y

...


If the value of x is less than or equal to y, swap the stack values.  Otherwise, leave the stack as is.



Minimum on the X Stack, Maximum on the X Stack:


HP 12C, HP 11C, HP 10C, and the HP 41C/DM41 family, due to the lack of the  x≥y command:


... 

x≤y

x<>y

x<>y

...


Same routine as the maximum routine, except an extra swap command is placed.



All others:


... 

x≥y

x<>y

...


x≥y is TEST 9 on the HP 15C.  


If the value of x is greater than or equal to y, swap the stack values.  Otherwise, leave the stack as is.

Of course, if your calculator has the maximum (MAX) and minimum (MIN) functions, by all means, use them.  



Eddie


All original content copyright, © 2011-2024.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, September 3, 2023

Python: Basic Functions with Quaternions

 Python:   Basic Functions with Quaternions   



Calculating with Quaternions



Quaternions are four-dimensional hypercomplex numbers that is written as the form:


r = a * i + b * j + c * k + d


We can also write quaternions as a four dimensional vector [a, b, c, d].


In computer graphics, quaternions are used to draw, display, move, and rotate 3D objects.  The constant term, d, is a mass-point, while the other three terms describe the location of vector point.



Some Mathematical Properties of Quaternions



The conjugate of a quaternion is similar to what a conjugate of a regular complex number would look like:


r* =  - a * i - b * j - c * k + d  


Similarly, the norm of a quaternion works in a familiar fashion:


| r | = abs(r) = √(a^2 + b^2 + c^2 + d^2)


We can multiply a quaternion by any scalar, s, as follows:


s * r = s*  a * i + s * b * j + a* r3 * k + a* r4  


To find the unit vector (unit quaternion), multiply the quaternion by the scalar 1/|r|.


Adding quaternions is communicative and associative.  However, multiplying quaternions is associative, but not communicative.  In short, when it comes to multiplying quaternions, order matters.  


For the complex coefficients:


i^2 = j^2 = k^2 = -1


i * j =  k,    j * i = -k 


j * k = i,   k * j = -i


k * i = j,  i * k = -j




List of Functions Included in QUAT.py



Quaternions are entered as vectors:


r = a * i + b * j + c * k + d -> [a, b, c, d]


qplus(r, q):   addition, r + q

qminus(r, q):  subtraction, r - q

qtimes(r,q):  multiplication,  r * q

qdivide(r,q):   division (multiply by the reciprocal):  r / q  = r * q^-1

qnorm(r):  norm or magnitude

qconj(r):  conjugate

qscale(r, a):   multiply quaternion r by a scalar a

qinv(r):  inverse or reciprocal of a quaternion,  1/r = r* / |r|

qsquare(r):  r^2


qhelp():  brings up the list of functions in QUAT plus.  


To use these functions on other Python scripts:


from QUAT import *


Important QUAT should also import the math module.  




Python:  Quaternions


This should work on all Python platforms since only the math module is used.  This was programmed on a TI-84 Plus CE Python calculator.




Python Code:  QUAT.py


# arithmetic with quaternions

# ews 2023-06-20


from math import *


# help

def qhelp():

  s="Quaternions - qhelp()"

  # add \n for new lines

  s+="\nEnter r=ai+bj+ck+d as [a,b,c,d]."

  s+="\nqplus(r,q) +  qminus(r,q) -"

  s+="\nqtimes(r,q) *  qdivide(r,q) /"

  s+="\nqnorm(r) magnitude \nqconj(r) conjugate \nqscalar(r,a) scalar mult. by a"

  s+="\nqinv(r) r**-1 qsquare(r) r**2"

  # need print to look nice

  return print(s)


# add

def qplus(r,q):

  return [r[i]+q[i] for i in range(4)]


# subtract

def qminus(r,q):

  q=[-i for i in q]

  return qplus(r,q)


# conjugate

def qconj(r):

  return [-r[i] for i in range(3)]+[r[3]]


# norm

def qnorm(r):

  s=sum([i**2 for i in r])

  return sqrt(s)


# inverse/reciprocal

def qinv(r):

  r=qconj(r)

  s=qnorm(r)

  s*=s

  return [i/s for i in r]


# scalar multiplication

def qscalar(r,a):

  return [a*i for i in r]


# multiplication

def qtimes(r,q):

  s=[0,0,0,0]

  s[0]=r[0]*q[3]+r[1]*q[2]-r[2]*q[1]+r[3]*q[0]

  s[1]=-r[0]*q[2]+r[1]*q[3]+r[2]*q[0]+r[3]*q[1]

  s[2]=r[0]*q[1]-r[1]*q[0]+r[2]*q[3]+r[3]*q[2]

  s[3]=r[3]*q[3]-r[0]*q[0]-r[1]*q[1]-r[2]*q[2]

  return s


# division

def qdivide(r,q):

  q=qinv(q)

  return qtimes(r,q)


# qsquare

def qsquare(r):

  return qtimes(r,r)


qhelp()



Download the script here:  https://drive.google.com/file/d/1iNDxw82Gm1nOVJ7jDHdnIIxA4tcaV0p3/view?usp=sharing



Source


Ron Goldman,

Understanding quaternions,

Graphical Models,

Volume 73, Issue 2,

2011,

Pages 21-49,

ISSN 1524-0703,

https://doi.org/10.1016/j.gmod.2010.10.004.

(https://www.sciencedirect.com/science/article/pii/S1524070310000172)


Science Direct requires a paid subscription or access through a university.


Alternate source:  https://www.researchgate.net/publication/220632454_Understanding_quaternions




All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, August 20, 2023

HP 42S and DM42: Multiplying Huge Positive Integers

HP 42S and DM42: Multiplying Huge Positive Integers





Introduction


The program LRG× multiplies to two large integers, allowing answers to extend beyond 12 digit capacity.  The product is shown in the alpha register.  How is this possible?  One way is to split the multiplier and multiplicand (also known as factors) into groups of digits.   This method is quite a complex process.  I will demonstrate with a simple example.




The Process Explained



Multiply: 


4,257 × 3,698 = 15,742,386


There are four digits in each of the factors (n = 4).


Split the numbers into groupings of two digits (n ÷ 2 =2).  Note that I use four registers to store the groups.   Memory registers R2 and R4 represent hundreds (10^2) while memory registers R1 and R3 represent units (10^0).


4257 = 42 × 10^2 + 57 

3698 = 36 × 10^2 + 98


R2 = 42, R1 = 57

R4 = 36, R3 = 98


Let memory register R5 be the units part of the product, up to 9999 (4 digits).   Let memory register R6 represent the part of the product 10,000 and above.  


On to the multiplication: 


Multiply R2 and R4, and store the results in R6.  In this case, 42 × 36 = 1512, which will R6 carry.   Memory register R6 represent ten-thousands (10^4) since R2 really is 4200 and R4 is really 3600, hence 4200 × 3600 = 15120000 = 1512 × 10^4.


Next multiply R1 and R3, then store the result in R5.   57 × 98 = 5586.   


We now have to take care of the cross product, which will represent hundreds (10^2).   This is done by the calculations of R2 × R3 + R4 × R1, which is 42 × 98 + 57 × 36 = 6168.  Note that this represents 6168 × 10^2 = 616800 = 610000 + 6800.  Add 61 to R6 (because R6 represents ten-thousands) and 6800 to R5.


In this example, the sums we have so far are:

R6 = 1573

R5 = 12386


R5 can only have four digits, we must carry over the 10000  (hence add 1 to R6, and drop the 1 from R5), to have a final result of:


R6 = 1573 + 1 = 1574

R5 = 2386


The answer is 15742386  (past R6 and R5 together).


Note:  Had R5 be less than 1000, R5 had to have four digits requiring a padding of zeroes (i.e. 712 becomes 0712, 16 become 0016).  


The program transfers R6 then R5 to the alpha register so the answer reads a long integer.   





In essence what we have done is:


4257 = 42 × 100 + 57 

3698 = 36 × 100 + 98


4257 × 3698 

= (42 × 10^2 + 57) × (36 × 10^2 + 98)

= (42 × 10^2 × 36 × 10^2) + (57 × 98) + (42 × 10^2 × 98 + 57 × 36 × 10^2)

= (1512 × 10^4) + 5586 + (4116 × 10^2 + 2052 × 10^2)

= (1512 × 10^4) + 5586 + (6168 × 10^2)

= 15120000 + 5586 + 616800

= 15742386


The program LRG× has larger unit digit capacity, up to 8 digits.   



HP 42S/Swiss Micros DM42 (including Free42 and Plus 42) Program:  LRG×


Raw file:  largemultiply.raw


Download the program here: https://drive.google.com/file/d/1KMCyGSSGeBvg0zT8UWvf4_uEaCVTfRwt/view?usp=sharing


Program Code:



00 { 156-Byte Prgm }

01▸LBL "LRG×"

02 ALL

03 XEQ 17

04 STO 02

05 XEQ 18

06 STO 01

07 R↓

08 XEQ 17

09 STO 04

10 XEQ 18

11 STO 03

12 RCL 02

13 RCL× 04

14 STO 06

15 RCL 01

16 RCL× 03

17 STO 05

18 RCL 01

19 RCL× 04

20 RCL 02

21 RCL× 03

22 +

23 ENTER

24 ENTER

25 XEQ 17

26 STO+ 06

27 LASTX

28 FP

29 8

30 10↑X

31 ×

32 STO+ 05

33 RCL 05

34 8

35 10↑X

36 X>Y?

37 GTO 16

38 ÷

39 ENTER

40 ENTER

41 IP

42 STO+ 06

43 R↓

44 FP

45 8

46 10↑X

47 ×

48 STO 05

49 GTO 16

50▸LBL 17

51 4

52 10↑X

53 ÷

54 IP

55 RTN

56▸LBL 18

57 LASTX

58 X<>Y

59 -

60 4

61 10↑X

62 ×

63 RTN

64▸LBL 16

65 CF 29

66 CLA

67 ARCL 06

68 8

69 RCL 05

70 X≠0?

71 GTO 21

72 8

73 GTO 22

74▸LBL 21

75 LOG

76 1

77 +

78 IP

79 -

80▸LBL 22

81 STO 07

82 X=0?

83 GTO 19

84▸LBL 20

85 48

86 XTOA

87 DSE 07

88 GTO 20

89▸LBL 19

90 ARCL 05

91 AVIEW

92 SF 29

93 .END.




Notes:


The program LRG× takes two integers from the stack.  This is meant to work on positive, non-zero integers.  


Flag 29 is the thousands separator flag.  Setting flag 29 turns them on while clearing it turns them off. In order to allow the alpha register have the long integer, flag 29 is cleared.


Memory register R5 represents units while R6 represents the part in hundred-millions.  


The program switches the display to ALL mode.  





Examples


Try these examples:  


54,195,365 × 40,857,695 = 2,214,297,693,583,675


12,068,999 × 50,245,126 = 606,408,375,448,874


50,700,600 × 33,800,020 = 1,713,681,294,012,000


58,763,110 × 6,758,999 = 397,179,801,726,890



Source


Hoffman, Dean and Mohler, Lee.   Mathematical Recreations for the Programmable Calculator  Hayden Book Company, Inc.   Rochelle Park:  New Jersey.  1982.  pp 146-166.  



Eddie 



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Sunday, August 6, 2023

Integer Division with Scientific Calculators

Integer Division with Scientific Calculators



Integer Division


A popular function of European scientific and fraction-featured calculators is the integer division function (also known as Euclidean division).  Integer division between two numbers (typically positive integers) return both the quotient and the remainder.


Example:  

456 int÷ 78 returns a quotient of 5 and a remainder of 66.


Here's a way to execute integer division with various calculators.



TI-36X Pro and TI-30X Pro Math Print


Integer division can be easily accomplished by using two functions:


Quotient:  Either int(x/y) or iPart(x/y)


Remainder:  mod(x,y)


Example:   456 int÷ 78

int(456/78) = 5,  mod(456, 78) = 66



Casio fx-991EX and Casio fx-991CW


Assuming x and y are positive integers, what we do depends on whether y is prime or composite.  We will assume that MathIO mode is activated.  


If y is prime:  We can divide x ÷ y, and change the result into a mixed format.


Example:  6140 int÷ 47

47 is prime.

Key in 6140 ÷ 47.  Change the result into a mixed format.  The result is 130 30/47.


Then the quotient is 130, the remainder is 47.


If y is not prime, we will not be able to do this because the fractions are always simplified to the irreducible form.


Then we will have to use the following steps:

1.   Divide x by y.   Take note of the integer portion (you may have to change the format to mixed fraction or decimal format first).   

2.  For the remainder, execute this formula:   x - quotient * y.  


Example:  5518 int÷ 32

32 is not prime.


1.  Calculate the quotient:  5518 ÷ 32 = 172 1/4.  Note that the integer part, 172 is the quotient.

2.  Calculate the remainder:  5518 - 172 * 32 = 14.  


Then the quotient is 172, the remainder is 14.  



Hewlett Packard HP 41C/Swiss Micros DM41X


Program Code:


01  LBL ᵀ INTD

02  x<>y

03  STO Z

04  x<>y

05  ST/ Z

06  MOD

07  x<>y

08  INT

09  x<>y

10  END



Eddie


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Symmetric Quartic Equation - Python

Symmetric Quartic Equation - Python Note: The code is programmed with a TI-84 Evo. No modules are used, so the scripts should be adopt...