Subject | RE: [ib-support] Firebird Workbench, number formats, retrieving data with API |
---|---|
Author | Henrik Sitter |
Post date | 2003-01-25T22:54:27Z |
Hi, Ann.
Thanks for your reply. I'm trying to decode the binary representation of
a float (using firebird v.1.0.0). Do you know if "IEEE 754 floating
point", "D_FLOAT floating point" or "G_FLOAT floating point" is used?
What about big endian or little endian?
So far I have not been able to decode correctly (trying all three (or
six) encodings), but I have done some testing and I'm pretty sure that
my database returns the correct binary representation. Here are some
examples:
If I store 201 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 32
Byte 4 to byte 0: 0
If I store 202 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 64 (+32 compared to storing 201)
Byte 4 to byte 0: 0
If I store 203 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 96 (+32 compared to storing 202)
Byte 4 to byte 0: 0
As you can see there is a clear pattern, and I have tried several other
values, and they all return similar kind of patterns. So as I said I do
think the data returned is correct.
Any suggestions?
Henrik
-----Original Message-----
From: Ann W. Harrison [mailto:aharrison@...]
Sent: Saturday, January 25, 2003 10:52 PM
To: ib-support@yahoogroups.com; ib-support@yahoogroups.com
Subject: Re: [ib-support] Firebird Workbench, number formats, retrieving
data with API
At 07:21 PM 1/23/2003 +0100, Henrik Sitter wrote:
example, if you define a field as NUMERIC (9, 3) and store in it
the value 10, you'll get the value 10000 come back. Within the
database that field is understood to evaluate to its stored
value * 10**-3.
Regards,
Ann
www.ibphoenix.com
We have answers.
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Thanks for your reply. I'm trying to decode the binary representation of
a float (using firebird v.1.0.0). Do you know if "IEEE 754 floating
point", "D_FLOAT floating point" or "G_FLOAT floating point" is used?
What about big endian or little endian?
So far I have not been able to decode correctly (trying all three (or
six) encodings), but I have done some testing and I'm pretty sure that
my database returns the correct binary representation. Here are some
examples:
If I store 201 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 32
Byte 4 to byte 0: 0
If I store 202 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 64 (+32 compared to storing 201)
Byte 4 to byte 0: 0
If I store 203 (as float/double precision), it returns:
Byte 7: 64
Byte 6: 105
Byte 5: 96 (+32 compared to storing 202)
Byte 4 to byte 0: 0
As you can see there is a clear pattern, and I have tried several other
values, and they all return similar kind of patterns. So as I said I do
think the data returned is correct.
Any suggestions?
Henrik
-----Original Message-----
From: Ann W. Harrison [mailto:aharrison@...]
Sent: Saturday, January 25, 2003 10:52 PM
To: ib-support@yahoogroups.com; ib-support@yahoogroups.com
Subject: Re: [ib-support] Firebird Workbench, number formats, retrieving
data with API
At 07:21 PM 1/23/2003 +0100, Henrik Sitter wrote:
>When using the Firebird API to retrieve data from tables, I get only BSBinary BS is sometimes difficult to tell from binary data. For
>back in columns with numerical data, but it works perfectly well with
>columns that store char or varchar.
example, if you define a field as NUMERIC (9, 3) and store in it
the value 10, you'll get the value 10000 come back. Within the
database that field is understood to evaluate to its stored
value * 10**-3.
Regards,
Ann
www.ibphoenix.com
We have answers.
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/