[Git][ghc/ghc][wip/js-staging] Fix encodeDouble/Float

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Mon Sep 26 12:16:44 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
980a3103 by Sylvain Henry at 2022-09-26T14:19:55+02:00
Fix encodeDouble/Float

- - - - -


1 changed file:

- rts/js/arith.js


Changes:

=====================================
rts/js/arith.js
=====================================
@@ -616,20 +616,20 @@ function h$decodeDoubleInt64(d) {
 
 function h$__int_encodeDouble(j,e) {
   if (!j) return 0;
-  return (j|0) ** (e|0);
+  return (j|0) * (2 ** (e|0));
 }
 
 function h$__word_encodeDouble(j,e) {
   if (!j) return 0;
-  return (j>>>0) ** (e|0);
+  return (j>>>0) * (2 ** (e|0));
 }
 
 function h$__int_encodeFloat(j,e) {
   if (!j) return 0;
-  return h$fround((j|0) ** (e|0));
+  return h$fround((j|0) * (2 ** (e|0)));
 }
 
 function h$__word_encodeFloat(j,e) {
   if (!j) return 0;
-  return h$fround((j>>>0) ** (e|0));
+  return h$fround((j>>>0) * (2 ** (e|0)));
 }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/980a3103036aebf41c1c647b443b995143330533

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/980a3103036aebf41c1c647b443b995143330533
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220926/0428102d/attachment-0001.html>


More information about the ghc-commits mailing list