Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: convert hex to float

2 views
Skip to first unread message

Birgir Sigurjonsson

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to

Hi, how do I convert hexadesimal to floating point in tcl/tk?
I thought I could use either scan or format, but I cannot get
it to work?

Regards,

Birgir Sigurjonsson.


Jeffrey Hobbs

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to

In article <53i7p9$9...@vkhdsu01.hda.hydro.com>,

Birgir Sigurjonsson <nho...@nho.hydro.com> wrote:
>Hi, how do I convert hexadesimal to floating point in tcl/tk?

Well, [scan $hex %x dec] will convert the hex to decimal and put it
in $dec. You can then just [append dec .0] or use double() in an expr.

--
Jeffrey Hobbs office: 541.683.7891
Nomad of the 'Net email: jho...@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~jhobbs/

0 new messages