Artifacts Associated With Ticket 852280ffffffffff
Ticket change [fcf3b0ba11] (rid 108327) by nobody on 2003-12-01 19:57:40:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi all ! I am using Linux 9 w Tcl 8.4.4.-34. Got a funny mistake from Tcl, maybe the new release fixes it, haven't checked it yet. Trying to convert string to binary double, 32Bit-float like this: set datei [open "test.bin" w] puts -nonewline $datei [binary format "f" [format "% E" 0.3705]] close $datei Problem: binary number yields 0.1869516 ! Also tried: "0.3705" "3.705E-1" instead of 0.3705 but problems still there. However, only some numbers are converted wrongly. E.g. 0.364 converts correctly ! To me, it looks arbitrary, but I see it on all my graphs (Exporting data from my db to scilab). Therefore I need exactly this binary format, no other avail. Ok. Trying new version but don't think this bug is resolved. Thanks in advance for the help Bjoern
- foundin initialized to: "obsolete: 8.4.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "11. Conversions from String"
- title initialized to: "binary format conversion error"
- type initialized to: "Bug"
Ticket change [73e25fbaea] (rid 105112) by dkf on 2003-12-02 07:02:28:
- assignee changed to: "dkf"
- closedate changed to: "2003-12-02T00:02:28"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 I bet that if you set your output channel to be a binary channel, everything will work. Add the following line after the [open] and before the [puts] and see if it helps... fconfigure $datei -translation binary
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"
Ticket change [b75341e91f] (rid 125568) by nobody on 2003-12-03 15:36:24:
- icomment:
Logged In: NO Thanks dkf, works so far with the addition of fconfigure. It's still weird in my opinion. The previous versions of Tcl did not require this command to work properly. Bjoern
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [515809e957] (rid 126124) by dkf on 2003-12-03 16:21:29:
- closedate changed to: "2003-12-03T09:21:29"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 That could be one of two things: a) You've previously been using 8.0 which didn't have the encoding subsystem in the first place. :^) b) You've previously been using 8.1, 8.2 or 8.3 which got the default encoding of all channels wrong (arguably). In 8.4 we switched the method used for computing the default encoding to something that does a better job for most purposes, but you're now not using ISO8859-1 as your default encoding (which just happened to work for binary data almost by chance.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"