brilliant!
-- Original Message ---
From: Benoit Minisini
To: nand...@nothingsimple.com, mailing list for gambas users
Sent: Sun, 14 Dec 2008 22:28:35 +0100
Subject: Re: [Gambas-user] Hex string to float
> On dimanche 14 décembre 2008, nando wrote:
> > My apologies t
Benoit Minisini wrote:
> On dimanche 14 décembre 2008, nando wrote:
>
>> My apologies to all...I stand corrected for my mistake.
>> The i = &h3fd5& converts hex to integer and is easiest to do it this
>> way. This method does performs as the original person wanted but is a waste
>> to do dis
On dimanche 14 décembre 2008, nando wrote:
> My apologies to all...I stand corrected for my mistake.
> The i = &h3fd5& converts hex to integer and is easiest to do it this
> way. This method does performs as the original person wanted but is a waste
> to do disk IO. Perhaps a pipe, write the i
ks,
-Fernando
-- Original Message ---
From: Doriano Blengino
To: nand...@nothingsimple.com, mailing list for gambas users
Sent: Sat, 13 Dec 2008 20:05:54 +0100
Subject: Re: [Gambas-user] Hex string to float
> nando ha scritto:
> > I'm sorry, but I cannot see this as c
> To: gambas-user@lists.sourceforge.net
> Sent: Sat, 13 Dec 2008 17:21:39 +0100
> Subject: Re: [Gambas-user] Hex string to float
>
>
>> ... For 32 Float use the "Single" data type.
>> See http://gambasdoc.org/help/cat/datatypes
>> See http://gambas
ssage ---
From: hjherb...@web.de
To: gambas-user@lists.sourceforge.net
Sent: Sat, 13 Dec 2008 17:21:39 +0100
Subject: Re: [Gambas-user] Hex string to float
> ... For 32 Float use the "Single" data type.
> See http://gambasdoc.org/help/cat/datatypes
> See http://gambasdoc.org/help/l
users
Sent: Sat, 13 Dec 2008 13:28:33 +0100
Subject: Re: [Gambas-user] Hex string to float
> nando schreef:
> > Two Questions:
> > 1) Is the HEX you show below the HEX representation of 4B of a IEEE 4B
> > Float?
> > 2) How do you get these values? (read in from file? som
... For 32 Float use the "Single" data type.
See http://gambasdoc.org/help/cat/datatypes
See http://gambasdoc.org/help/lang/type/single
The example conversion may be done by this way:
PUBLIC SUB DemoSingle()
DIM i AS Integer
DIM f AS Single
DIM hH AS File
i = &h3fd5&
OPEN "/tmp/hexfloat.tmp
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 (=
nando schreef:
> Two Questions:
> 1) Is the HEX you show below the HEX representation of 4B of a IEEE 4B Float?
> 2) How do you get these values? (read in from file? something else?)
> -Fernando
>
>
Yes those where IEEE floats, I needed the routine to decode values read
from zigbee devices cal
2008 19:42:09 +0100
Subject: Re: [Gambas-user] Hex string to float
> On Friday 12 December 2008, Ron wrote:
> > Ron schreef:
> > >
> > > Hi,
> > >
> > > Anyone have a routine to convert a hex string to a float?
> > > Like these:
> > >
PS
http://books.google.com/books?id=YMmepn2xCcMC&pg=PA46&lpg=PR14&dq=floating+number+in+binary++z80&output=html
page is 46 DATA REPRESENTATION.
I did not trust the notation of sign exponent mantisa and found another source
about it.
There was my orginal sequence of sign., mantisa, exponent.
As
On Friday 12 December 2008, Ron wrote:
> Ron schreef:
> >
> > Hi,
> >
> > Anyone have a routine to convert a hex string to a float?
> > Like these:
> > B6FBEB3A = -0.07507766895287204
> > 3C5D2104 = 0.01349664106965065
> >
> > Find lots of vb code, but those use copymem functions.
> >
> > Thank
Ron schreef:
>
> Hi,
>
> Anyone have a routine to convert a hex string to a float?
> Like these:
> B6FBEB3A = -0.07507766895287204
> 3C5D2104 = 0.01349664106965065
>
> Find lots of vb code, but those use copymem functions.
>
> Thanks in advance!
>
To answer my own question:
I ended up with thi
Hi,
Anyone have a routine to convert a hex string to a float?
Like these:
B6FBEB3A = -0.07507766895287204
3C5D2104 = 0.01349664106965065
Find lots of vb code, but those use copymem functions.
Thanks in advance!
Regards,
Ron_2nd
-
15 matches
Mail list logo