3 ms·
>> Also, any floating-point operation performed on a NaN will give back the same NaN. > This is not entirely true. As I say two sentences prior: > a couple o
by moonchild 4y ago
>> Also, any floating-point operation performed on a NaN will give back the same NaN.
> This is not entirely true.
As I say two sentences prior:
> a couple of qualities near-ubiquitous on modern processors and architectures
Obviously, this won't work if you don't do nan-propagation. It also won't work if you don't have vector ops at all, or if they're much slower than the scalar ops.
I will add: if you are guaranteed a particular nan, you can just use that as your tag. (Although it looks like riscv uses a nan with an all-zero mantissa, which is unfortunate, as it means using it as the low-bits tag slows down integer math.)
> you also have to worry about whether or not the compiler will guarantee NaN payload preservation
The target audience is authors of compilers for dynamically-typed programming languages.