< prev index next >

test/script/basic/NASHORN-389.js

Print this page




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * NASHORN-389 : number to string conversion issues.
  26  *
  27  * @test
  28  * @run
  29  */
  30 
  31 print(1000000000000000000000);
  32 print(0.000000000100000000000);
  33 print(1e-5);
  34 var x = -1.23456789e+21;
  35 var y = -1.23456789e+20;
  36 print(x.toFixed(9));
  37 print(y.toFixed(9).indexOf(",") === -1); // no grouping
  38 //print(y.toFixed(9)); // FIXME expected: -123456788999999995904.000000000
  39 //print(1000000000000000128); // FIXME expected: 1000000000000000100
  40 //print((1000000000000000128).toFixed(0)); // FIXME expected: 1000000000000000128


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * NASHORN-389 : number to string conversion issues.
  26  *
  27  * @test
  28  * @run
  29  */
  30 
  31 print(1000000000000000000000);
  32 print(0.000000000100000000000);
  33 print(1e-5);
  34 var x = -1.23456789e+21;
  35 var y = -1.23456789e+20;
  36 print(x.toFixed(9));
  37 print(y.toFixed(9).indexOf(",") === -1); // no grouping
  38 print(y.toFixed(9));
  39 print(1000000000000000128); 
  40 print((1000000000000000128).toFixed(0));
< prev index next >