This is the mail archive of the
mailing list for the GCC project.
Re: Bug in std::floor?
On 11/09/2017 05:53 PM, Vincent Lefevre wrote:> For instance:
int main (void)
double x = 1.7;
printf ("%.30g\n", x);
printf ("%.30g\n", 100 * x);
printf ("%.30g\n", floor (100 * x));
Indeed! I would really like to have a look at the floor implementation,
but it has proven difficult. It calls __builtin_floor, that is no where
to be found. It seems to be implemented in gcc/builtins.c but it's too
obfuscated for me to understand.
despite the fact that 1.7 is approximated by a value less than 1.7.