mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
Add a constant function to the float module that returns positive infinity.
This is implemented for the C, Java, and C# backends.
The Erlang backend currently does not support it
library/float.m:
Add the new function.
Address review comments from Paul about my previous change.
tests/hard_coded/Mmakefile:
tests/hard_coded/test_infinity.{m,exp}:
Test various operations involving infinity.
NEWS:
Announce the addition.
16 lines
401 B
Plaintext
16 lines
401 B
Plaintext
write_float(infinity) = infinity
|
|
write_float(-infinity) = -infinity
|
|
to infinity and beyond!
|
|
format(-infinity) = -infinity
|
|
is_infinite(infinity) = yes
|
|
is_infinite(-infinity) = yes
|
|
is_finite(infinity) = no
|
|
is_finite(-infinity) = no
|
|
is_nan(infinity) = no
|
|
is_nan(-infinity) = no
|
|
is_zero(infinity) = no
|
|
is_zero(-infinity) = no
|
|
abs(infinity) = infinity
|
|
abs(-infinity) = infinity
|
|
pow(infinity, 0) = 1.000000
|