RosettaCodeData/Task/Tropical-algebra-overloading/Julia/tropical-algebra-overloading.jl
2024-10-16 18:07:41 -07:00

13 lines
286 B
Julia

(x, y) = max(x, y)
(x, y) = x + y
(x, y) = (@assert round(y) == y && y > 0; x * y)
@show 2 -2
@show -0.001 -Inf
@show 0 -Inf
@show 1.5 -1
@show -0.5 0
@show 57
@show 5 (8 7)
@show 5 8 5 7
@show 5 (8 7) == 5 8 5 7