Repository navigation
Commit 56604dd
committed
fix: decide a zero spelling from the text, not the parse
Review found that testing `value == 0.0` discarded the digits of any value too
small for a float. '0.' followed by 400 zeros and a 1 -- plain decimal text,
exactly what a <floatstring> is for -- underflowed and rendered 0.0, silently a
different number. The cutoff was an artifact of binary64 rather than anything in
the template: 1e-320 is subnormal and survived, 1e-400 did not.
Ask the text instead. An all-zero mantissa spells zero whatever the exponent, so
'0.00', '-0.0' and '0e5' lose their sign and keep their digits, while '1e-400'
and '0.000...1' keep both. Mirrors openjd_expr::value::text_spells_zero, so
openjd-rs#354 renders every one of these identically.
Verification. Model suite 5536 passed, 24 skipped, 3 xfailed; ruff, black and
mypy clean. Full 2023-09 conformance 1162 passed, 0 failed.
Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>1 parent ccf4cba commit 56604dd
2 files changed
Lines changed: 24 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
1252 | 1260 | | |
1253 | 1261 | | |
1254 | 1262 | | |
| |||
1262 | 1270 | | |
1263 | 1271 | | |
1264 | 1272 | | |
1265 | | - | |
| 1273 | + | |
1266 | 1274 | | |
1267 | 1275 | | |
1268 | 1276 | | |
1269 | 1277 | | |
1270 | 1278 | | |
1271 | 1279 | | |
1272 | 1280 | | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1280 | 1286 | | |
1281 | 1287 | | |
1282 | 1288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
493 | | - | |
494 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
495 | 498 | | |
496 | 499 | | |
497 | 500 | | |
| |||
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
531 | 534 | | |
532 | 535 | | |
533 | 536 | | |
| |||
0 commit comments