Overview
| Artifact ID: | 6b0bb28d78a0c30ebbfd546d87b30721c834812d51687bb400e5074845dc7484 |
|---|---|
| Ticket: | 42d14c495a096159841d2601a16850273713b31b
Parsing long floating point strings |
| User & Date: | chw on 2023-09-22 09:16:17 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed to:
The following snippet gives strange results when the mantissa gets large enough: for {set i 1} {$i < 1000} {incr i} { set s 1.[string repeat 1 $i]e-321 set d "" scan $s %g d if {$d eq ""} break puts [format "%3d: %.20g" $i $d] if {$d == inf || $d == -inf} break } Output on x86_64 Linux for 8.6.11, core-8-branch, trunk: 1: 1.1017663902259797935e-321 2: 1.1116477031428047244e-321 ... 190: 1.1116477031428047244e-321 191: 8.2870452568891190738e+36 ... 701: -1.6598062275523971834e+181 702: 8.2870452568891190738e+36 703: inf Expectation: like C library sscanf(str, "%lg", &d), i.e. ... 703: 1.1116477031428047244e-321 ... 999: 1.1116477031428047244e-321 - foundin changed to: ">= 8.6"
- is_private changed to: "0"
- login: "chw"
- priority changed to: "5 Medium"
- private_contact changed to: "1f3e737132a26109e72276643b4e9814a2e846d1"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "chw"
- subsystem changed to: "48. Number Handling"
- title changed to: "Parsing long floating point strings"
- type changed to: "Bug"