I have the following piece of c++ code:
void update(const int step, const int total) const
{
double s = static_cast<double>(step);
double t = static_cast<double>(total);
std::cout << s/t <<"------\n";
// etc...
}
I am using the intel c++ compiler with the -fp-trap=all flag activated. When running the code through gdb I get the following error:
Program received signal SIGFPE, Arithmetic exception.
0x000000000040ee07 in NilDa::progressBar::update (this=0x7fffffffbc9c, step=1, total=60000) at /home/d2d/dev/NilDa/sources/utils/progressBar.h:69
69 std::cout << s/t <<"------\n";
I don't really understand what is going on. The division seems to be well defined.