RosettaCodeData/Task/Pathological-floating-point-problems/Crystal/pathological-floating-point-problems-5.crystal
2023-07-01 13:44:08 -04:00

8 lines
235 B
Text

require "big"
def rump(a, b)
a, b = a.to_big_r, b.to_big_r
333.75.to_big_r * b**6 + a**2 * (11 * a**2 * b**2 - b**6 - 121 * b**4 - 2) + 5.5.to_big_r * b**8 + a / (2 * b)
end
puts "rump(77617, 33096) = #{rump(77617, 33096).to_f}"