473,698 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

floating point error: overflow?

Hi,

i´ve got an iteration with random generated floating point numbers.
During the iteration process sometimes the programm stops with the error:
"floating point error: overflow"

Is the number out of range? what does it exactly mean?

Thanks, Chris
Nov 13 '05 #1
3 9820

"C. Sengstock" <c.*********@ur z.uni-heidelberg.de> wrote in message
news:bk******** **@news.urz.uni-heidelberg.de.. .
Hi,

i´ve got an iteration with random generated floating point numbers.
During the iteration process sometimes the programm stops with the error:
"floating point error: overflow"

Is the number out of range?
Essentially yes.
what does it exactly mean?


You tried to store a representation that is
invalid for a floating point type on your
implementation.

-Mike
Nov 13 '05 #2
On Thu, 25 Sep 2003 03:19:53 GMT, "Mike Wahler"
<mk******@mkwah ler.net> wrote in comp.lang.c:

"C. Sengstock" <c.*********@ur z.uni-heidelberg.de> wrote in message
news:bk******** **@news.urz.uni-heidelberg.de.. .
Hi,

i´ve got an iteration with random generated floating point numbers.
During the iteration process sometimes the programm stops with the error:
"floating point error: overflow"

Is the number out of range?


Essentially yes.
what does it exactly mean?


You tried to store a representation that is
invalid for a floating point type on your
implementation.

-Mike


Not even store, necessarily. Just generate.

double d = DBL_MAX;
++d;

....can generate an exception or trap.

BTW, could you start using a proper signature separator?

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #3

"Jack Klein" <ja*******@spam cop.net> wrote in message
news:9r******** *************** *********@4ax.c om...
On Thu, 25 Sep 2003 03:19:53 GMT, "Mike Wahler"
<mk******@mkwah ler.net> wrote in comp.lang.c:

"C. Sengstock" <c.*********@ur z.uni-heidelberg.de> wrote in message
news:bk******** **@news.urz.uni-heidelberg.de.. .
Hi,

i´ve got an iteration with random generated floating point numbers.
During the iteration process sometimes the programm stops with the error: "floating point error: overflow"

Is the number out of range?
Essentially yes.
what does it exactly mean?


You tried to store a representation that is
invalid for a floating point type on your
implementation.

-Mike


Not even store, necessarily. Just generate.


Right. Thanks.
double d = DBL_MAX;
++d;

...can generate an exception or trap.

BTW, could you start using a proper signature separator?


Sure, as soon as I start using a sig.

-Mike
Nov 13 '05 #4

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

Similar topics

10
6714
by: Vinny | last post by:
I have a few floating point questions/issues I wish to ask. An answer or discussion would be nice too :) Any links discussion the subject would be nice too.. 1. How do I generate an underflow exception for testing purposes? 2. What is the fastest wat to suppress floating point exceptions? Take the following situation as example. float x = 1.0e38, //max float value
12
3799
by: Dave Rahardja | last post by:
Does the C++ standard specify the behavior of floating point numbers during "exceptional" (exceptional with respect to floating point numbers, not exceptions) conditions? For example: double a = 1.0 / 0.0; // What is the value of a? Infinity? double b = 0.0 / 0.0; // What is the value of b? NaN? What about overflow/underflow conditions in the library? Is HUGE_VAL always a
0
494
by: C. Sengstock | last post by:
Hi, i´ve got an iteration with random generated floating point numbers. During the iteration process sometimes the programm stops with the error: "floating point error: overflow" Is the number out of range? what does it exactly mean? Thanks, Chris
7
2580
by: Daniel Vallstrom | last post by:
I am having trouble with floating point addition because of the limited accuracy of floating types. Consider e.g. x0 += f(n) where x0 and f are of some floating type. Sometimes x0 is much larger than f(n) so that x0 + f(n) == x0. For example, x0 could be 2**300*(1.1234...) while f(n) is 2**100*(1.4256...). If x0 + f(n) == x0 I still sometimes want the addition of f(n) to x0 to have some effect on x0. A good solution seems to be to update...
3
3795
by: Mark L Pappin | last post by:
<puts on Compiler Vendor hat> I've recently discovered that our compilers don't make any attempt to handle floating point overflow in add/subtract/ multiply/divide, with the result that programmers who don't range- check their data can e.g. multiply two very tiny values and end up with a very large one. This is (AFAICT) quite fine according to the Standard but is certainly a QoI issue and I'd like to raise ours. I believe that it's...
13
7780
by: tings | last post by:
An article states: "In floating point maths, where if you divide by a sufficiently large number sufficiently often, you will always be able to reach a value too small to distinguish from zero, given the finite precision you have." What happens when "a value too small to distinguish from zero" is reached by the above division? Underflow? What does it mean "sufficiently often" since only one division should be enough to cause underflow...
2
15857
by: Benjamin Rutt | last post by:
Does anyone have C code laying around to do this? I have to read in some binary data files that contains some 4-byte IBM/370 floating point values. I would like a function to convert 4-byte IBM/370 float values into IEEE 754 'float' values that I can use directly with any modern C environment (that uses IEEE 754). I can handle endian conversion myself (the files are stored as big endian, and I'll process them on a little endian...
4
2833
by: jacob navia | last post by:
Hi people I continue to work in the tutorial for lcc-win32, and started to try to explain the floating point flags. Here is the relevant part of the tutorial. Since it is a difficult part, I would like your expert advise before I publish any serious nonsense. Any comments are welcome, style, organization, hard errors, etc.
26
9430
by: y8ycgl | last post by:
i have a program that i made in my class in Turbo C++ on windows 95or98 i belive. it is made to solve for factorials. th problem is that : A) it puts it in exponents B) theres too many numbers to count so i need a way to put commas every 3 digits and i dont know how to do that. C) any factorials over 1754 give the computer an error that says: Floating point: overflow here is my program: #include<iostream.h> #include<iomanip.h>
0
8675
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.