floating-point-exceptions Questions
1
numpy allows one to handle IEEE-754 exceptions originating from floating-point by using np.seterr appropriately. However seterr only supports the following keywords each corresponding to a IEEE-754...
Callaghan asked 6/10, 2020 at 10:42
1
Solved
The behaviour of the code snippet below is different when compiled with g++-11.1.1 with different optimisation options. The snippet has floating point exception handling enabled. I don't think algo...
Escamilla asked 20/7, 2021 at 14:38
1
Solved
I like to run my code with floating point exceptions enabled.
I do this under Linux using:
feenableexcept( FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
So far so good.
The issue I am having, is that...
Cowberry asked 28/7, 2020 at 1:51
2
Solved
Let's say I have some 16-bytes aligned structure, that just wraps 3xFloat32 array:
#[repr(C, align(16))]
pub struct Vector(pub [f32; 3]);
Now I want to divide two instances of it, like this:
us...
Quadriplegia asked 8/10, 2019 at 6:39
1
Solved
I've run into an issue with floating-point comparisons. When comparing a value with NaN using the < operator, I expect the FE_INVALID flag to be set. The < operator should raise the flag acco...
Lees asked 7/2, 2019 at 11:9
1
Solved
I'm not dividing by zero and there is no float datatype in my code, I still get floating point exception.
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostre...
Terhune asked 11/7, 2018 at 22:14
2
Solved
I'm trying to test some of the functions in fenv.h, however, when I compile the below function ld fails with undefined reference to 'feclearexcept' and undefined reference to 'fetestexcept'. I'm ru...
Unstable asked 17/10, 2015 at 21:1
4
Solved
I have an assignment of expaining some seemingly strange behaviors of C code (running on x86). I can easily complete everything else but this one has really confused me.
Code snippet 1 outputs -21...
Holohedral asked 23/9, 2017 at 9:32
2
Solved
I get into a situation where calculating 1.77e-308/10 triggers an underflow exception, but calculating 1.777e-308/10 does not. This is strange because:
Underflow occurs when the true result of ...
Cacciatore asked 16/2, 2017 at 14:44
3
Solved
As I brought up in this question, gcc is removing (yes, with -O0) a line of code _mm_div_ss(s1, s2); presumably because the result is not saved. However, this should trigger a floating point except...
Israelisraeli asked 3/10, 2016 at 13:34
1
For days I am struggling hard (but in vain) with the exception masks.
I have developed an application that makes heavy floating point calculations on hundreds of thousands of records. Obviously th...
Ainsworth asked 4/12, 2014 at 1:13
3
Solved
I have a long program, which consists of one header file, and two source files, in the first one I have written the implementations of the functions, and in the second one (which is my main), I cal...
Roid asked 25/6, 2013 at 14:22
4
I'd like to play with those traps for educational purpose.
A common problem with the default behavior in numerical calculus is that we "miss" the Nan (or +-inf) that appeared in a wrong operation....
Stealth asked 30/3, 2009 at 21:19
2
To find the cause of floating point variables beeing set to NaN in my C++ program I enabled floating point exceptions like this:
#include <fenv.h>
feenableexcept(FE_INVALID | FE_OVERFLOW);
...
Jaunitajaunt asked 22/3, 2011 at 16:19
2
Solved
Is it possible to have an overflow (wrap around) with a double or a float? What will happen if the maximum (or minimum) value is reached on x86 or x64 hardware?
Pucida asked 20/4, 2012 at 3:13
1
Solved
In Delphi 2010 and Delphi 2007 I am using Set8087CW on WebBrowserBeforeNavigate / WebBrowserDocumentComplete to prevent FPU errors inside ActiveX to cripple my application.
But somehow this is not...
Macarthur asked 20/2, 2012 at 9:59
1
Solved
I have weird problem with this code: if I run it like shown below I get error:
An invalid floating point operation occurred.
But if I change parameter @Longitude to -98.508730 (notice only las...
Kilan asked 12/1, 2012 at 14:53
1
I've configured Visual Studio to throw floating point exceptions via the _controlfp function. This works for NAN and INF, but not QNAN. I.e. Quiet NaNs don't cause an exception to be raised. Is the...
Charmain asked 15/12, 2010 at 21:34
4
Solved
Is there any way to set up Visual Studio (just upgraded from 2008 to 2010) to break, as if an assertion failed, whenever any floating point number becomes NaN, QNAN, INF, etc?
Up until now I have ...
Eu asked 15/12, 2010 at 20:31
2
Solved
On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions. How can I do this on Mac OS X Intel?
Inline assembly for enabl...
Discernment asked 29/10, 2008 at 14:41
1
© 2022 - 2024 — McMap. All rights reserved.