Jack Kelly
New Member
I see no benefit from anonymity.
Posts: 19
|
Post by Jack Kelly on Jun 27, 2024 13:06:43 GMT -5
I was browsing through Rosetta Code recently and discovered this Liberty Basic interpretation of Euclid’s Algorithm. It is a function that returns the greatest common divisor of two integers. Have you ever seen anything so beautiful? The single character numeric variables are priceless.
print GCD(105, 252) print GCD(126, 84) print GCD(39, 52)
function GCD(a,b) while b c = a a = b b = c mod b wend GCD = abs(a) end function
I have always been in awe of the algorithm for computing “e” — Euler’s Number. How can something so profound be so pure and simple? Amazing.
e = 1 for x=1 to 11 e = e + 1/factorial(x) next x print e
function factorial(n) if n<1 then exit function factorial = 1 for x=1 to n factorial = factorial*x next x end function
Leonard Euler knew that the universe could be described with simple mathematical terms, for example e^i(pi)=-1. If he were alive today, he would be the chief mathematician at the CERN particle physics laboratory. He would have cemented the foundations for Feynman diagrams, quantum mechanics, general relativity, and gravitation.
Please post your own favorite examples of elegant simplicity. We have much we can learn from each other.
|
|