Tcl Source Code

View Ticket
Login
2026-10-23
09:32 • Ticket [2dff98e079] format %A garbles negative, padded and infinite values s... artifact: 51cb0e070f user: serhiy.storchaka
09:31 • Closed ticket [40f315bc23]: format %g does not portably produce a Tcl number</... artifact: f9600e6087 user: serhiy.storchaka
09:29
Fix [40f315bc23]: [format %g] does not portably produce a Tcl number check-in: 326e1bf923 user: serhiy.storchaka tags: core-8-6-branch
2014-10-22
12:43 • Ticket [40f315bc23] format %g does not portably produce a Tcl number statu... artifact: 2f446a1406 user: dgp
12:41 • New ticket [40f315bc23]. artifact: c33264b224 user: dgp

Ticket UUID: 40f315bc23254916454748dce97ae62978ca9406
Title: [format %g] does not portably produce a Tcl number
Type: Bug Created on: 2014-10-22 12:41:49
Submitter: dgp Assigned to: kbk
Subsystem: 48. Number Handling Severity: Important
Priority: 8 Last modified: 2026-10-23 09:31:36
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-23 09:31:36
Version: all
Description:
On Windows:

% expr [format %g [expr {1.0/0.0}]]
invalid character "#"
in expression "1.#INF"

Either we need to take control of [format]
so it stops producing renegade results like
this, or we need to expand our number parser
to recognize this string as a valid rep for
Inf.

Why o why o why o why....
User Comments:
serhiy.storchaka added on 2026-10-23 09:31:36:

With msvcrt.dll (e.g. MinGW builds), 8.6 still gave 1.#INF. Fixed on main and 9.0 by [185825858e], backported to 8.6 in [326e1bf923].