Tropical algebra overloading: Difference between revisions

Content added Content deleted
m (R example)
m (→‎{{header|R}}: use cat)
Line 108: Line 108:
}
}


print(paste("2 %*% -2 ==", 2 %*% -2))
cat("2 %*% -2 ==", 2 %*% -2, "\n")
print(paste("-0.001 %+% -Inf ==", 0.001 %+% -Inf))
cat("-0.001 %+% -Inf ==", 0.001 %+% -Inf, "\n")
print(paste("0 %*% -Inf ==", 0 %*% -Inf))
cat("0 %*% -Inf ==", 0 %*% -Inf, "\n")
print(paste("1.5 %+% -1 ==", 1.5 %+% -1))
cat("1.5 %+% -1 ==", 1.5 %+% -1, "\n")
print(paste("-0.5 %*% 0 ==", -0.5 %*% 0))
cat("-0.5 %*% 0 ==", -0.5 %*% 0, "\n")
print(paste("5^7 ==", 5 %^% 7))
cat("5^7 ==", 5 %^% 7, "\n")
print(paste("5 %*% (8 %+% 7)) ==", 5 %*% (8 %+% 7)))
cat("5 %*% (8 %+% 7)) ==", 5 %*% (8 %+% 7), "\n")
print(paste("5 %*% 8 %+% 5 %*% 7 ==", 5 %*% 8 + 5 %*% 7))
cat("5 %*% 8 %+% 5 %*% 7 ==", 5 %*% 8 + 5 %*% 7, "\n")
</lang>{{out}}
</lang>{{out}}
<pre>
<pre>