Floating Point Error Stack Underflow
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to handle floating-point Underflow? up vote 3 down vote favorite 1 I try to understand c++ numerical properties. Thus, I am interested by the Underflow phenomenon. Can anyone give me an example of an Underflow and the way to handle it? c++ floating-point underflow share|improve this question edited Jul 12 '13 at 9:38 Pascal Cuoq 58.5k5101194 asked Jul 12 '13 at 8:14 WildThing 170213 1 0U-1. By putting a UB tag, though, I assume you mean signed underflow. –chris Jul 12 '13 at 8:15 @chris (let's assume 32-bit unsigned for the sake of argument) technically, there's no under/overflow there: the result of 0U-1 is 4294967295, not -1. 4294967295 fits in a 32-bit unsigned int and therefore doesn't overflow. By contrast, the result of -2147483648-1 is -2147483649 which doesn't fit on a signed 32-bit int and therefore overflows/underflows. –R. Martinho Fernandes Jul 12 '13 at 8:33 @R.MartinhoFernandes, I knew I should have typed out those extra characters, even if I got lazy and just used INT_MIN. Either way would probably be less than the note I had to tag on, too. That's kind of depressing. –chris Jul 12 '13 at 8:38 1 The use of “numerical” makes me think the question is about floating-point underflow, which is not undefined behavior (inasmuch as the compiler chooses to provide IEEE 754 floating-point semantics). –Pascal Cuoq Jul 12 '13 at 9:08 @PascalCuoq it is about doubles underflow –WildThing Jul 12 '13 at 9:10 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted An example of floating-point underflow is: double d = DBL_MIN / 3.0; A conforming IEEE 754 implementation should set d to a “subnormal”, that is, a number that is so close to zero that precision is reduced. You will find plenty of information on Wikipedia. Some implementations may “Flush to Zero”. The consequence in the example above is to set d to zero. An underflow is the result of
Programming Boards C++ Programming floating point stack underflow Getting started with C or C++ | C Tutorial | C++ Tutorial | C and C++ FAQ | Get a compiler | Fixes for common problems Thread: floating point stack underflow Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-25-2005 #1 Curtux View Profile View Forum http://stackoverflow.com/questions/17610464/how-to-handle-floating-point-underflow Posts Registered User Join Date Nov 2004 Posts 3 floating point stack underflow When I run the program I get a floating point stack underflow error. I have searched but I can't seem to seem to find the solution. Any other errors are not my worry now just the stack underflow. Code: /* This program http://cboard.cprogramming.com/cplusplus-programming/60978-floating-point-stack-underflow.html will allow the user to display the formula for calculating the area of a figure. r = rectangle t = triangle c = circle p = parallelogram */ /////////////////////////////////////////////////////////////////////////// #include
Tech Talk and Support floating point error If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: http://www.hardwarecentral.com/showthread.php?57915-floating-point-error click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 1 of 1 Thread: floating point error Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode October 10th, 1999,12:46 PM #1 BlindWillie View Profile View Forum Posts floating point Junior Member Join Date Jan 1999 Posts 29 floating point error Man this computer has been giving several errors from the blue screen Fatal Exception at 06, et to cannot create a temp dir due to HPFS or NTFS. It is a basic clone with a 200 pentium old board. I have tried everything from testing the cd-rom to the hd and all seems to work. When I finally got to the cd-rom floating point error Win95 set up during the scandisk it froze at an error saying at the top "Runtime error M6111: Math floating point error: stack underflow. Is this the CPU gone bad or what? Ken Reply With Quote Quick Navigation General Tech Talk and Support Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums General Forums General Tech Talk and Support PC and Console Gaming Software Hardware Forums CPUs and Motherboards Cases, Cooling, and Overclocking PC Audio and Home Theater PC Video, Digital Imaging, and Displays Storage and Peripherals Networking and the Internet Mobile Technology Community HWC Feedback Central Lounge For Sale Or Trade « Previous Thread | Next Thread » Thread Information Users Browsing this Thread There are currently 1 users browsing this thread. (0 members and 1 guests) Posting Permissions You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Forum Rules -- hardwarecentral yellow -- Default Mobile Style Contact Us HardwareCentral Forums Archive Top All times are GMT -4. The time now is 05:24 PM. Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.