Float number as you mean are 32 bit float numbers see 
http://en.wikipedia.org/wiki/Single_precision
Float numbers in GAMBAS are 64 bit float numbers see 
http://en.wikipedia.org/wiki/Double_precision

The follow program demonstrates how to convert a 64 Bit long value into a 64 
bit gambas FLOAT (=double precision) value:

PUBLIC SUB Main()
DIM f AS Float
DIM l AS Long
DIM hH AS File


l = &h3fd5555555555555&

OPEN "/tmp/hexfloat.tmp" FOR WRITE CREATE AS #hH
WRITE #hH, l
CLOSE #hH
OPEN "/tmp/hexfloat.tmp" FOR READ AS #hH
READ #hH, f
CLOSE #hH
PRINT "l=", l, "HEX", Hex$(l), "  f=", f

END



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to