Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big doubles lose precision #5

Open
kripken opened this issue Jul 4, 2015 · 1 comment
Open

Big doubles lose precision #5

kripken opened this issue Jul 4, 2015 · 1 comment

Comments

@kripken
Copy link
Contributor

kripken commented Jul 4, 2015

emscripten's tests/cases/bigdouble.ll emits (in asm1 mode)

function _main() {
 var $0 = 0.0, $vararg_buffer = 0, label = 0, sp = 0;
 sp = STACKTOP;
 STACKTOP = STACKTOP + 16|0;
 $vararg_buffer = sp;
 $0 = 4.0083367200179456E-292 * 1.0000000000000001E+300;
 HEAPF64[$vararg_buffer>>3] = $0;
 (_printf((8|0),($vararg_buffer|0))|0);
 STACKTOP = sp;return 0;
}

which is packed and unpacked into

function $ao(){
  var k=0,l=0,m=0,n=0.;
  m=$ab;
  $ab=$ab+16|0;
  k=m;
  n=4.00834e-292*1.e+300;
  h[k>>3]=n;
  $A(8,k|0)|0;
  $ab=m;
  return 0;
}

Note the first double has lost precision.

@kripken
Copy link
Contributor Author

kripken commented Jul 4, 2015

Also happens in test_closebitcasts on a smaller number, 1073741824.0 => 107374e4.

kripken added a commit to kripken/polyfill-prototype-1 that referenced this issue Jul 4, 2015
@kripken kripken mentioned this issue Jul 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant