Closed tethal closed 8 years ago
float
version of the operators do not work either:
printf("%s\n", @nan@ < 1.0);
printf("%s\n", @nan@ <= 1.0);
printf("%s\n", @nan@ == 1.0);
printf("%s\n", @nan@ != 1.0);
printf("%s\n", @nan@ === 1.0);
printf("%s\n", @nan@ !== 1.0);
printf("%s\n", @nan@ > 1.0);
printf("%s\n", @nan@ >= 1.0);
Produces (all should be False):
0
1
0
1
0
1
0
1
As part of this issue, we should also check:
@inf@n
is greater than any other number except @inf@n == @inf@n
and @inf@n != @nan@n
-@inf@n
is less than any other number except -@inf@n == -@inf@n
and -@inf@n != @nan@n
Also:
qore -nX '1 == @nan@n'
True
qore -nX '1.0 == @nan@n'
True
For more details see comments in #910
From
mpfr_cmp
documentation:Qore ignores the erange flag and interprets the zero return value as 'equal' (qore_number_private.h:261)