parseShortCut.js 831 B

123456789101112131415161718192021222324
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function Test(i)
  6. {
  7. WScript.Echo(parseInt(i).toString());
  8. WScript.Echo(parseFloat(i).toString());
  9. WScript.Echo(parseInt(-i).toString());
  10. WScript.Echo(parseFloat(-i).toString());
  11. }
  12. Test(400012312542180394829e30);
  13. Test(4.00012312542180394829e21);
  14. Test(4.00012312542180394829e20);
  15. Test(9.9999999999999999999e20);
  16. Test(1e20);
  17. Test(Infinity);
  18. Test(NaN);
  19. Test(0.00001);
  20. Test(0.000001);
  21. Test(0.0000001);
  22. Test(0.0000000000000001);