Lines Matching refs:NaN
10 # sign : +,-,NaN,+inf,-inf
154 my $nan = 'NaN'; # constants for easier life
538 $self->{value} = $CALC->_zero(); # for all the NaN cases
601 # create a bigint 'NaN', if given a BigInt, set it to 'NaN'
612 Carp::croak ("Tried to set $self to NaN in $class\::bnan()");
627 delete $self->{_a}; delete $self->{_p}; # rounding NaN is silly
766 return $x->{sign} unless $x->{sign} eq '+inf'; # -inf, NaN
783 return $x->{sign} unless $x->{sign} eq '+inf'; # -inf, NaN
806 # return the sign of the number: +/-/-inf/+inf/NaN
823 # returns ($self) or ($self,$a,$p,$r) - sets $self to NaN of both A and P
963 # post-normalized abs for internal use (does nothing for NaN)
977 $x->{sign} =~ tr/+-/-+/ if !$x->is_zero(); # does nothing for NaN
1000 # handle +-inf and NaN
1045 # handle +-inf and NaN
1072 # inf and NaN handling
1075 # NaN first
1080 # +inf++inf or -inf+-inf => same, rest is NaN
1143 $y->{sign} =~ tr/+\-/-+/; # does nothing for NaN
1145 $y->{sign} =~ tr/+\-/-+/; # refix $y (does nothing for NaN)
1185 return $x->badd($self->bone('-'),@r) unless $x->{sign} eq '+'; # inf/NaN
1217 # inf, -inf, NaN, <0 => NaN
1264 return $x->bnan() if $x->{sign} !~ /^[+-]$/; # x NaN?
1270 return $x->bnan() if $y->{sign} !~ /^[+-]$/; # y NaN?
1296 return 0 if $x->{sign} !~ /^\+$/; # -, NaN & +-inf aren't
1302 # return true if arg (BINT or num_str) is NaN
1329 return 0 if $x->{sign} ne $sign; # -1 != +1, NaN, +-inf aren't either
1338 return 0 if $x->{sign} !~ /^[+-]$/; # NaN & +-inf aren't
1347 return 0 if $x->{sign} !~ /^[+-]$/; # NaN & +-inf aren't
1356 $x->{sign} =~ /^\+/ ? 1 : 0; # +inf is also positive, but NaN not
1364 $x->{sign} =~ /^-/ ? 1 : 0; # -inf is also negative, but NaN not
1373 $x->{sign} =~ /^[+-]$/ ? 1 : 0; # inf/-inf/NaN aren't
1426 # NaN if x == NaN or y == NaN or x==y==0
1431 # +-inf / +-inf == NaN, reminder also NaN
1572 # (i.e. their gcd is not one) then NaN is returned.
1585 if ($y->{sign} ne '+' # -, NaN, +inf, -inf
1587 || $x->{sign} !~ /^[+-]$/ # or num NaN, inf, -inf
1612 return $num->bnan() if ($mod->{sign} ne '+' # NaN, - , -inf, +inf
1618 # i.e., if it's NaN, +inf, or -inf...
1624 # check num for valid values (also NaN if there was no inverse but $exp < 0)
1643 return $x->bnan() if $x->{sign} ne '+'; # NaN, <0 etc => NaN
1916 return 0 if $x->{sign} !~ /^[+-]$/; # NaN, inf, -inf etc
1928 return $x->bnan() if $x->{sign} !~ /^\+/; # -x or -inf or NaN => NaN
1954 # NaN handling: $x ** 1/0, x or y NaN, or y inf/-inf or y == 0
1969 # return a copy of the exponent (here always 0, NaN or 1 for $m == 0)
1974 my $s = $x->{sign}; $s =~ s/^[+-]//; # NaN, -inf,+inf => NaN or inf
1989 # for NaN, +inf, -inf: keep the sign
2069 return $x if $x->{sign} !~ /^[+-]$/; # inf, NaN
2532 return; # NaN, not a number
2591 $x->is_nan(); # if $x is NaN
2604 $x->sign(); # return the sign, either +,- or NaN
2613 $x->bnan(); # set $x to NaN
2724 Non-integer values result in NaN.
2727 results in 'NaN'. This might change in the future, so use always the following
2728 explicit forms to get a zero or NaN:
2788 trap_nan If true, traps creation of NaN via croak()
2911 Creates a new BigInt object representing NaN (Not A Number).
2912 If used on an object, it will set it to NaN:
2951 $x->is_nan(); # true if arg is NaN
2969 C<NaN> is neither positive nor negative, while C<+inf> counts as positive, and
2985 The return true when the argument satisfies the condition. C<NaN>, C<+inf>,
2988 In BigInt, all numbers except C<NaN>, C<+inf> and C<-inf> are integers.
3007 Return the sign, of $x, meaning either C<+>, C<->, C<-inf>, C<+inf> or NaN.
3020 and '-inf', respectively. Does nothing for NaN or zero.
3027 and from '-inf' to '+inf', respectively. Does nothing for NaN or positive
3077 Returns the inverse of C<$num> in the given modulus C<$mod>. 'C<NaN>' is
3439 * Only one of A or P can be defined, otherwise the result is NaN
3476 effect, and the other P, this results in an error (NaN).
3625 The sign is either '+', '-', 'NaN', '+inf' or '-inf' and stored seperately.
3627 A sign of 'NaN' is used to represent the result when input arguments are not
3645 Currently, for BigInts C<$e> is always 0, except for NaN, +inf and -inf,
3646 where it is C<NaN>; and for C<$x == 0>, where it is C<1> (to be compatible
3736 an truncated result or a NaN.
4091 0/ 0 = NaN