<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META content="MSHTML 5.50.4522.1800" name=GENERATOR><STYLE></STYLE></HEAD><BODY bgColor=#ffffff><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>Or you can use: IP number = asReal64(A) * 16777216 + B * 65536 + C * 256 + D</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>... which amounts to the same thing really.</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003></SPAN></FONT> </DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>One thing to watch out for when using Real64 to represent values which are really integers is that Real64 has maximum number of significant figures (I think the max is 16). So if your integer has more digits than that you run into trouble - integers this large cannot be accurately represented using Real64 (or any other VEE data type except text, which would not be very useful).</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>This doesn't apply in the context below, because you only have 10 digits max.</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>UInt32 would solve the problem. So would Int64.</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003></SPAN></FONT> </DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003>Warren</SPAN></FONT></DIV><DIV><FONT face=Arial color=#0000ff size=2><SPAN class=796272008-04122003></SPAN></FONT> </DIV><BLOCKQUOTE> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Andersen Dave-P26278 [mailto:Dave.Andersen@gdds.com]<BR><B>Sent:</B> 03 December 2003 20:00<BR><B>To:</B> VRF<BR><B>Subject:</B> [vrf] RE: Unsigned Int32<BR><BR></FONT></DIV> <DIV><SPAN class=407205519-03122003><FONT face=Arial color=#0000ff size=2>The easiest way is to say <FONT color=#000000>IP Number = A x 16777216.0 + B x 65536 + C x 256 + D. Vee automatically converts to Real64.</FONT></FONT></SPAN></DIV> <DIV><SPAN class=407205519-03122003><FONT face=Arial color=#0000ff size=2><FONT color=#000000></FONT></FONT></SPAN> </DIV> <DIV><SPAN class=407205519-03122003><FONT face=Arial color=#0000ff size=2><FONT color=#000000>Dave Andersen</FONT></DIV> <DIV><BR></DIV></FONT></SPAN> <BLOCKQUOTE> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Nelson Mambre [mailto:nmambre@seebeck.com.ve]<BR><B>Sent:</B> Wednesday, December 03, 2003 12:19 PM<BR><B>To:</B> VRF<BR><B>Subject:</B> [vrf] Unsigned Int32<BR><BR></FONT></DIV> <DIV><FONT face=Arial size=2>Hi all,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>How do I represent an integer in the range of 0 to 4294967295 (2^32 - 1)?</FONT></DIV> <DIV><FONT face=Arial size=2>I'm calculating IP numbers from dotted IP address. The formula to convert an IP Address of the form A.B.C.D to an IP Number is:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>IP Number = A x 16777216 + B x 65536 + C x 256 + D<BR>When I use a formula box, it returns error 514 (overflow). How can I indicate to give the result in UInt32 or Real?</FONT></DIV> <DIV><FONT face=Arial size=2> </DIV></FONT> <DIV><FONT face=Arial size=2>Thanks and regards,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Nelson Mambre <BR>Ingeniero de Desarrollo<BR>Seebeck C.A.<BR>Caracas, Venezuela<BR>Tel. +58-212-906-4276<BR>Fax +58-212-962-0871<BR><A href="http://www.seebeck.com.ve">www.seebeck.com.ve</A></FONT></DIV>---<BR>You are currently subscribed to vrf as: Dave.Andersen@gdds.com<BR>To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".<BR>To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".<BR>To send messages to this mailing list, email "vrf@agilent.com". <BR>If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com". </BLOCKQUOTE>---<BR>You are currently subscribed to vrf as: Warren.Pickles@tycoelectronics.com<BR>To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".<BR>To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".<BR>To send messages to this mailing list, email "vrf@agilent.com". <BR>If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com". </BLOCKQUOTE>---<BR>You are currently subscribed to vrf as: rsb@soco.agilent.com<BR>To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".<BR>To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".<BR>To send messages to this mailing list, email "vrf@agilent.com". <BR>If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".</BODY></HTML>
Nelson,
Instead of multiplying, use the bitshift(a,b) function, it will look like:
P Number = bitshift(A, 24) + bitshift(B, 16) + bitshift(C, 8) + D
lBill
"Nelson Mambre"
<nmambre@seebeck. To: VRF <vrf@agilent.com>
com.ve> cc:
Subject: [vrf] Unsigned Int32
12/03/2003 02:19
PM
Please respond to
"Nelson Mambre"
Hi all,
How do I represent an integer in the range of 0 to 4294967295 (2^32 - 1)?
I'm calculating IP numbers from dotted IP address. The formula to convert
an IP Address of the form A.B.C.D to an IP Number is:
IP Number = A x 16777216 + B x 65536 + C x 256 + D
When I use a formula box, it returns error 514 (overflow). How can I
indicate to give the result in UInt32 or Real?
Thanks and regards,
Nelson Mambre
Ingeniero de Desarrollo
Seebeck C.A.
Caracas, Venezuela
Tel. +58-212-906-4276
Fax +58-212-962-0871
www.seebeck.com.ve
---
You are currently subscribed to vrf as: lbill@us.ibm.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".