Repository navigation
Commit 0e24863
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 fbf09d5 commit 0e24863
2 files changed
Lines changed: 24 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1265 | 1273 | | |
1266 | 1274 | | |
1267 | 1275 | | |
| |||
1275 | 1283 | | |
1276 | 1284 | | |
1277 | 1285 | | |
1278 | | - | |
| 1286 | + | |
1279 | 1287 | | |
1280 | 1288 | | |
1281 | 1289 | | |
1282 | 1290 | | |
1283 | 1291 | | |
1284 | 1292 | | |
1285 | 1293 | | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1293 | 1299 | | |
1294 | 1300 | | |
1295 | 1301 | | |
| |||
| 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