public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97086] New: aix: ceilf and truncf do not preserve the sign bit when output is rounded to 0
@ 2020-09-17 13:01 mfarazma.ext at gmail dot com
  2020-09-17 16:32 ` [Bug target/97086] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mfarazma.ext at gmail dot com @ 2020-09-17 13:01 UTC (permalink / raw)
  To: gcc-bugs

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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-13 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 13:01 [Bug c++/97086] New: aix: ceilf and truncf do not preserve the sign bit when output is rounded to 0 mfarazma.ext at gmail dot com
2020-09-17 16:32 ` [Bug target/97086] " pinskia at gcc dot gnu.org
2020-10-13 15:30 ` mfarazma.ext at gmail dot com
2020-10-13 15:39 ` mfarazma.ext at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).