This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #120543] work around a C++ library bug in VC 2003
[perl5.git] / util.c
diff --git a/util.c b/util.c
index c68bb90..68893c4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -6252,7 +6252,7 @@ Perl_drand48_r(perl_drand48_t *random_state)
     *random_state = (*random_state * DRAND48_MULT + DRAND48_ADD)
         & DRAND48_MASK;
 
     *random_state = (*random_state * DRAND48_MULT + DRAND48_ADD)
         & DRAND48_MASK;
 
-    return ldexp(*random_state, -48);
+    return ldexp((double)*random_state, -48);
 #else
     {
     U32 accu;
 #else
     {
     U32 accu;