forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Convert numbers larger than 32-bit to Hex?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Aug 28, 2006 8:27 am    Post subject: Convert numbers larger than 32-bit to Hex? Reply with quote

Does anyone know a work around for the "32-bit number" limitation?

I need to write a number, that could be as large as 19327352832, to a file as hex. I can get the large number into a variable... but @hex (like all VDS functions) does not work with numbers larger than 2147483648.

Or any command-line tool that I can send the number to and get the hex value returned?

_________________
cheers

Dave
Back to top
View user's profile Send private message
mmatica
Newbie


Joined: 03 Dec 2004
Posts: 12

PostPosted: Mon Aug 28, 2006 6:00 pm    Post subject: Re: Convert numbers larger than 32-bit to Hex? Reply with quote

DaveŽ wrote:
Does anyone know a work around for the "32-bit number" limitation?

I need to write a number, that could be as large as 19327352832, to a file as hex. I can get the large number into a variable... but @hex (like all VDS functions) does not work with numbers larger than 2147483648.

Or any command-line tool that I can send the number to and get the hex value returned?


You can use the function:

:xhex
%1 = @fint(%1)
%q = @fint(@fdiv(%1,268435456))
%r = @fsub(%1,@fmul(%q,268435456))
exit @hex(%q,1)@hex(%r,7)


Mate
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Aug 28, 2006 11:40 pm    Post subject: Reply with quote

Thanks Mate.
_________________
cheers

Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group