Skip to content

Big doubles lose precision #5

Description

@kripken

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions