I found the answer to this problem.
set hex "d32942bc"
set bin [binary format H8 $hex]
binary scan $bin f* float
puts "$float"
Being so new to Tcl I don't know if there's a "gotsha" in this but it seems to work. If anyone has more information of when this won't work please let me know...
I'm new to Tcl and need some help. I have a string that represents a float - example: bc4229d3 = -0.011850791. I can convert it to an integer but not to a float. In C I can cast it but I can't find a way to do that in Tcl. I know I can call a C routine but I would prefer to do it in Tcl only if...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.