[Git][ghc/ghc][wip/js-staging] encodeDouble: correctly handle 0 base

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Thu Sep 22 13:03:22 UTC 2022



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


Commits:
765da290 by Sylvain Henry at 2022-09-22T15:06:25+02:00
encodeDouble: correctly handle 0 base

- - - - -


1 changed file:

- rts/js/arith.js


Changes:

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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/765da2901c14e7eae70a2996fc60c71aff3566a8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/765da2901c14e7eae70a2996fc60c71aff3566a8
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/20220922/b03d94c9/attachment-0001.html>


More information about the ghc-commits mailing list