Explorar el Código

add a couple of tests for Std.parseFloat regarding scientific float notation (see #4051)

Dan Korostelev hace 10 años
padre
commit
8a0460bde2
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      tests/unit/src/unitstd/Std.unit.hx

+ 4 - 0
tests/unit/src/unitstd/Std.unit.hx

@@ -84,6 +84,10 @@ Math.isNaN(Std.parseFloat(null)) == true;
 Std.parseFloat("5.3 ") == 5.3;
 Std.parseFloat("0.0") == 0.;
 Std.parseFloat("5.3 1") == 5.3;
+Std.parseFloat("2.426670815e+12") == 2.426670815e+12;
+Std.parseFloat("2.426670815E+12") == 2.426670815e+12;
+Std.parseFloat("2.426670815e-12") == 2.426670815e-12;
+Std.parseFloat("2.426670815E-12") == 2.426670815e-12;
 
 // random
 var x = Std.random(2);