473,395 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Inserting 99999.99 into a FLOAT 17 16 field results in 5 being added to the end of the number

Hi,

Inserting number 99999.99 into a FLOAT 17 16 field results in
9.99999900....5E+004 being inserted into the base.

What is confusing me is the digit 5 that appears at the end of the
number. Where does it come from and what does it mean? I have tried to
find something by searching about rounding, but so far didn't find
anything helpful.

If I insert number 99999.00, I don't get the number 5 at the end.

Apr 22 '07 #1
2 2288
si*********@gmail.com wrote:
Hi,

Inserting number 99999.99 into a FLOAT 17 16 field results in
9.99999900....5E+004 being inserted into the base.

What is confusing me is the digit 5 that appears at the end of the
number. Where does it come from and what does it mean? I have tried to
find something by searching about rounding, but so far didn't find
anything helpful.

If I insert number 99999.00, I don't get the number 5 at the end.
I don't know what a "FLOAT 17 16 field" is supposed to be, but I assume you
see quite normal rounding differences related to floating point numbers.

Are you aware of this article?
http://docs.sun.com/source/806-3568/ncg_goldberg.html It explains a few
things that you should really know when dealing with floating point
numbers.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Apr 22 '07 #2

Knut Stolze je napisao/la:
si*********@gmail.com wrote:
Hi,

Inserting number 99999.99 into a FLOAT 17 16 field results in
9.99999900....5E+004 being inserted into the base.

What is confusing me is the digit 5 that appears at the end of the
number. Where does it come from and what does it mean? I have tried to
find something by searching about rounding, but so far didn't find
anything helpful.

If I insert number 99999.00, I don't get the number 5 at the end.

I don't know what a "FLOAT 17 16 field" is supposed to be, but I assume you
see quite normal rounding differences related to floating point numbers.
FLOAT field of length 17 and scale 16. Length is number of digits and
scale is number of digits to the right of the decimal point. This is
DB2 for iSeries, so those may be called differently in other versions.
Are you aware of this article?
http://docs.sun.com/source/806-3568/ncg_goldberg.html It explains a few
things that you should really know when dealing with floating point
numbers.
Thanks for the link. The article is lengthy so I've just skimmed it,
but this thing I am seeing could be the "guard digit" that is
mentioned there. Not sure.

Apr 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: 1111111111 | last post by:
Here is what I need to do... I need to enter a 5 digit number from 11111 to 99999 and have the output look like this.. Example I enter 12345..It needs to look like this when it outputs. 1 2 ...
0
by: xixi | last post by:
hi, we are running db2 udb v8.1 on windows, when i try to retrieve a view's data , i get the error SQL10007N Message "99999" could not be retrieved. Reason code: "4". what is message 99999? i...
2
by: Goran | last post by:
Hi! I need to convert from a unsigned char array to a float. I don't think i get the right results in the program below. unsigned char array1 = { 0xde, 0xc2, 0x44, 0x23}; //I'm not sure in...
3
by: Neils Christoffersen | last post by:
Hey all, I wrote on Friday asking for some help moving a common subclass field up to the base class (original post and followup included below). This entails storing whole numbers inside float...
2
by: julien | last post by:
Hi, I am using Sybase 12.5 dataserver and ASP.NET I am calling a stored procedure from my asp.net page, in this stored procedure, I have 2 float fields that are returned. One is directly taken...
16
by: Enekajmer | last post by:
Hi, 1 int main() 2 { 3 float a = 17.5; 4 printf("%d\n", a); 5 printf("%d\n", *(int *)&a); 6 return 0; 7 }
19
by: morc | last post by:
hey, I have float values that look something like this when they are printed: 6.0E-4 7.0E-4 I don't want them to be like this I want them to be normalized with 4 decimal places.
3
by: seagullino | last post by:
Hello, I've developed my first Form, a simple affair that enables the user to search text in the memo fields in our database. When the "search" button is pressed, it runs a macro which runs the...
22
by: Bill Reid | last post by:
I just noticed that my "improved" version of sscanf() doesn't assign floating point numbers properly if the variable assigned to is declared as a "float" rather than a "double". (This never...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.