[Bug c++/64497] std::scalbln does not round correctly for long doubles

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 5 12:29:00 GMT 2015


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC just calls the scalnlnl() function in libm, so it's not a GCC bug, and is
not specific to C++ either. I suggest you report it to your libc vendor.

Complete testcase in C:

#include <stdio.h>
#include <math.h>
#include <assert.h>

int main()
{
  long double di = scalbnl(1.1L, -16446);
  assert( di != 0.0L );
  long double dl = scalblnl(1.1L, -16446L);
  assert( dl != 0.0L );
}



More information about the Gcc-bugs mailing list