Am 25.03.2025 um 15:52 schrieb Riccardo (Jack) Lucchetti:
On 25/03/2025 15:46, Sven Schreiber wrote:
> <console>
>
> ? matrix hello = {1/0} # to get invalid input
> ? = eigensym(hello)
> Not a Number geschah bei Berechnung
> ? = eigen(hello)
> 1.#INF
>
> ? = svd(hello)
> nan
>
> </console>
>
> So we have everything: a hard-stopping error, some IEEE code (?), and
> a gretl code. Plus, with a 6x6 matrix input I also saw that eigen()
> spat out a "Data error".
Ouch
> I think it would be good if this could be a little harmonized, no?
Is it even possible to do without breaking backwards compatibility? I
we don't care about that, I'd favour stopping with an error rather
than returning NAs (FWIW, stopping with an error is what both Octave
and R do).
In this case I guess there will necessarily be some incompatibility
involved.
BTW, notice that with the input above you have to be careful how to
check for validity:
<console>
? = missing(hello)
0
? = isnan(hello)
0
? = ok(hello)
0
</console>
So only ok() indicates a problem here - I'm not saying those are bugs,
since it is true that 1.#INF is neither missing nor NaN in the narrow
sense (AFAIK), just that one has to be careful. As a side note, the
missing() reference doesn't mention a matrix type as input, and the ok()
reference explicitly says about the missing function that it's not for
matrices.
cheers
sven