zlacker

[parent] [thread] 2 comments
1. andyfe+(OP)[view] [source] 2025-12-05 13:38:06
> floats can be NaN and integers should be low(int) if they are invalid (low(int) is a pointless value anyway as it has no positive equivalent).

I have long thought that we need a NaI (not an integer) value for our signed ints. Ideally, the CPU would have overflow-aware instructions similar to floats that return this value on overflow and cost the same as wrapping addition/multiplication/etc.

replies(2): >>mikepu+Tj >>fithis+sH2
2. mikepu+Tj[view] [source] 2025-12-05 15:13:25
>>andyfe+(OP)
From an implementation point of view, it would be similar to NaN; a designated sentinel value that all the arithmetic operations are made aware of and have special rules around producing and consuming.
3. fithis+sH2[view] [source] 2025-12-06 07:56:20
>>andyfe+(OP)
R has it.
[go to top]