Commit 7279816
authored
fix(core): gf16_from_f32(NaN) returns NaN instead of +inf (#45)
fromF32 collapsed NaN into infinity because the non-finite branch
set mant=0 (the infinity encoding) without checking isNan first.
Split into separate isNan and isInf checks; NaN now encodes as
exp=0x3F, mant=1 (canonical GF16_NAN = 0x7E01).
Add C-ABI test for NaN preservation round-trip.
Closes #381 parent 04b50cc commit 7279816
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
288 | 292 | | |
289 | 293 | | |
290 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
0 commit comments