| 1 |
# This test case adds some numbers and the answer is 42. |
| 2 |
# It was written to honour the scientists who solved a longstanding |
| 3 |
# problem that was made popular by Douglas Adams in his book |
| 4 |
# The Hitchhiker's Guide to the Galaxy. |
| 5 |
# https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy |
| 6 |
# In September 2019, the University of Bristol made a release |
| 7 |
# about the solution they found: |
| 8 |
# https://www.bristol.ac.uk/news/2019/september/sum-of-three-cubes-.html |
| 9 |
# |
| 10 |
# This test case uses GAWK's big numbers to reproduce the calculation. |
| 11 |
|
| 12 |
BEGIN { |
| 13 |
x = -80538738812075974 |
| 14 |
y = 80435758145817515 |
| 15 |
z = 12602123297335631 |
| 16 |
print x^3 + y^3 + z^3 |
| 17 |
} |
| 18 |
|