On 08/08/2018 02:58 PM, shivax wrote:
> ans = 1
> it's possible?
This is standard IEEE floating-point stuff. Not-A-Numbers should not
test as equal to anything, even themselves. So gg != gg ought to be
true. it is one way of testing for NaNs in many languages.
NaN is to be assigned to a computation, when the result of an operation
is not well defined. There are many ways to produce answers which are
not well defined. Because of this, one NaN does not (necessarily) equal
another NaN. Octave provides a function which will tell you if the
result is NaN (isnan).
> Mapping Function: isnan (x)
> Return a logical array which is true where the elements of x are
> NaN values and false where they are not.
> NA values are also considered NaN values. For example: