comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » hexadecimal variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: hexadecimal variables [message #15167 is a reply to message #15093] Fri, 23 April 1999 00:00 Go to previous messageGo to previous message
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
Pavel Romashkin <promashkin@cmdl.noaa.gov> wrote:
> This is received from the outside.
> h_string = '40000FC0DA'

> h_long = long(h_string)
> This, obviously, fails to recognize alphabetical hexadecimal part and
> sets h_long to 40,000.

> temp = execute("h_long = long(' "+h_string+" 'x)")
> This, naturally, works, setting h_long to the desired 1032410

As others have pointed out, its a 64 bit string.

Looking at your "execute", I thought that

wmc> h_long = long(h_string+''x)
Ought to work, but it produces
wmc> print,h_long
-2556760
(I'd forgotten that its a 64-bit string)

However,
wmc> h_long = long64(h_string+''x)
Seems to work perfectly well
wmc> print,h_long
4398043954346

- William

--
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Better Fitting routine
Next Topic: Searching in a sorted array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 06:10:16 PDT 2025

Total time taken to generate the page: 8.00206 seconds