Skip to content
Tcl Source Code History Of Ticket 852280ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 852280ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 852280ffffffffffffffffffffffffffffffffff

  1. Ticket change [fcf3b0ba11] (rid 108327) by nobody on 2003-12-01 19:57:40:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.4.4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "11. Conversions from String"
    10. title initialized to: "binary format conversion error"
    11. type initialized to: "Bug"
  2. Ticket change [73e25fbaea] (rid 105112) by dkf on 2003-12-02 07:02:28:

    1. assignee changed to: "dkf"
    2. closedate changed to: "2003-12-02T00:02:28"
    3. closer changed to: "dkf"
    4. 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
      
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"
    9. username: "dkf"
  3. Ticket change [b75341e91f] (rid 125568) by nobody on 2003-12-03 15:36:24:

    1. 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 
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  4. Ticket change [515809e957] (rid 126124) by dkf on 2003-12-03 16:21:29:

    1. closedate changed to: "2003-12-03T09:21:29"
    2. closer changed to: "dkf"
    3. 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.)
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"