Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Integer / Double to Hex?


Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2001, 03:53 AM
andig
Guest
 
Posts: n/a
Question Integer / Double to Hex?

Hi!

Can anybody describe me (or give me a link) how the internal conversion of integer/double values work? I try to analyse a file written by visual basic with integer / double values when I look to it by a Hex-Editor.

Andi Goering

Reply With Quote
  #2  
Old 08-01-2001, 10:36 AM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
 
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default Re: Integer / Double to Hex?

Integer and Double are completely different. Integers and Longs can be converted to HEX easily using the <font color=blue>Hex</font color=blue> function, but I dont think Doubles can.

__________________
Search the forums | Use [vb][/vb] tags | Still IRCing
Reply With Quote
  #3  
Old 08-01-2001, 10:57 AM
andig
Guest
 
Posts: n/a
Default Re: Integer / Double to Hex?

Hi!

I'm not searching for a funtion who do it, but for the algorithm because I want to generate a file on a other system (IBM-EBCDIC-World) I have to know the details
about such a function, what it does internal.

Can anybody help me?

Reply With Quote
  #4  
Old 08-01-2001, 11:14 AM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: Integer / Double to Hex?

According to MSDN, the double type consists of
1 bit for the sign
11 bits for the exponent
52 bits for the mantissa (+1 implied high order bit)

for a total of 64 bits (+1 implied).

The implied bit business refers to the fact that a binary mantissa always starts with 1. Therefore, the most significant bit can be left out since we know it is always one.



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #5  
Old 08-01-2001, 11:14 AM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: Integer / Double to Hex?



I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb