Re: NA and NaN representation on mips64el

Rafael Laboissière <[email protected]> Fri, 16 May 2025 07:31:19 +0200
Newsgroups gmane.linux.debian.riscv,gmane.linux.debian.ports.mips
Organization Debian GNU/Linux
Message-ID <[email protected]>
* James Cloos <[email protected]> [2025-05-15 20:15]:

> some years ago (how time flies) someone pushed a patch for R (upstream) 
> to stop using nan-with-payload for na.  it looks like octave also needs 
> such a change for architectures which support only canonical nans.
>
> such as riscv. (and mips?)
>
> the respective licenses (2or3 -> 3) would permit any octave patch to 
> borrow from how R now handles na.

I am not familiar with NaN/NA coding in either R or Octave, so I 
apologise if my comment below is irrelevant.

I found this explanation of the internal representation of NA in R: 
https://stackoverflow.com/questions/70471859/difference-between-na-real-and-nan/70472081#70472081

It seems that R is still using NaN-with-payload to represent NA 
internally: 
https://github.com/wch/r-source/blob/2016493d7e73252d5e0cdf302ea4ba9e814b392f/src/main/arithmetic.c#L90

@JimC, could you please provide more information about the patch you 
mentioned?

Best,

Rafael