diff mbox

Use ldexp instead of scalbln for portability (PR other/64370)

Message ID 20150112201038.GR1405@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 12, 2015, 8:10 p.m. UTC
Hi!

As mentioned in the PR, HPUX doesn't have scalbln, but does have ldexp and
that function is already used in gcj-dump, so supposedly it is more portable
to use ldexp.  Also in glibc it is defined in libc in addition to libm.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2015-01-12  Jakub Jelinek  <jakub@redhat.com>

	PR other/64370
	* sreal.c (sreal::to_double): Use ldexp instead of scalbnl.


	Jakub

Comments

Jeff Law Jan. 12, 2015, 8:26 p.m. UTC | #1
On 01/12/15 13:10, Jakub Jelinek wrote:
> Hi!
>
> As mentioned in the PR, HPUX doesn't have scalbln, but does have ldexp and
> that function is already used in gcj-dump, so supposedly it is more portable
> to use ldexp.  Also in glibc it is defined in libc in addition to libm.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2015-01-12  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR other/64370
> 	* sreal.c (sreal::to_double): Use ldexp instead of scalbnl.
OK.  Got to love HPUX.

jeff
diff mbox

Patch

--- gcc/sreal.c.jj	2015-01-09 12:01:33.000000000 +0100
+++ gcc/sreal.c	2015-01-12 14:26:44.339128332 +0100
@@ -122,7 +122,7 @@  sreal::to_double () const
 {
   double val = m_sig;
   if (m_exp)
-    val = scalbln (val, m_exp);
+    val = ldexp (val, m_exp);
   return val;
 }