473,729 Members | 2,149 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 9827

"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
6716
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
3803
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
2582
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
3796
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
7783
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
15865
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
2835
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
9438
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
8913
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
8761
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
9280
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
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...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
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...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2162
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.