Floating Point Exception in Integer Math?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I'm testing signed int32 operations (division, modular reduction, and
overflow), and came across a floating point exception:

	int32_t aa = INT32_MIN;
	int32_t bb = -1;
	int32_t rr = aa % bb;

	cout << rr << " = " << aa << " % " << bb << endl;

There's not much to the command line: `g++ sitest.cpp -o sitest.exe`.
I was kind of surprised GCC [silently] moved from the integer domain
to the floating point domain.

Is this expected behavior?

Jeff


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux