https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97086

            Bug ID: 97086
           Summary: aix: ceilf and truncf do not preserve the sign bit
                    when output is rounded to 0
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mfarazma.ext at gmail dot com
  Target Milestone: ---

Test program:

#include <iostream>
#include <math.h>

int main(){
         float input = -0.1;
         printf("%f\n", ceilf(-0.1));  // -0.000000 , correct
         printf("%f\n", ceilf(input)); // 0.000000  , wrong
  return 0;
}

Compile with:
g++ test.cc
./a.out

"ceilf" does not preserve the sign bit when its input is passed by value and
the output is rounded to 0.

The same happens when using "truncf".

Reply via email to