World's greatest assistant!
Charles Babbage's Analytical Engine (designed 1837; never built)
Example from David Chiu. Disclaimer: Fake example!
LOAD Contents of A
LOAD Contents of B
LOAD Contents of C
MULTIPLY C and 4 and STORE in TMP
SUBTRACT TMP from B and STORE in TMP
ADD A to TEMP and STORE in TEMP
STORE TEMP in D
# Write this instead #
LOAD A
LOAD B
LOAD C
MULTIPLY C and 4 and STORE in TMP
SUBTRACT TMP from B and STORE in TMP
ADD A to TEMP and STORE in TEMP
STORE TEMP in D
LOAD
to 010101
, etc.
# Write this instead #
LOAD A
LOAD B
LOAD C
MULTIPLY C and 4 and STORE in TMP
SUBTRACT TMP from B and STORE in TMP
ADD A to TEMP and STORE in TEMP
STORE TEMP in D
# This is the programming language Python
# It means something reasonable, I swear!
import math
def roots(a, b, c):
det = math.sqrt(b * b - 4 * a * c)
x1 = (-b + det)/(2 * a)
x2 = (-b - det)/(2 * a)
return (x1, x2)
x = roots(1, 5, -14)
print(x)
# Any idea what this program does?