uint.js 810 B

123456789101112131415161718192021222324252627282930
  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. let asmHeap = new ArrayBuffer(1 << 20);
  6. let m1 = function (stdlib, foreign, heap) {
  7. 'use asm';
  8. function f(d0) {
  9. d0 = +d0;
  10. return 1 % ~~d0 | 0;
  11. }
  12. return f;
  13. }({}, {}, asmHeap);
  14. m2 = function (stdlib, foreign, heap) {
  15. 'use asm';
  16. function f(d0) {
  17. d0 = +d0;
  18. return 1 % (~~d0 >>> 0) | 0;
  19. }
  20. return f;
  21. }({}, {}, asmHeap);
  22. print(m1(4294967295));
  23. print(m1(4294967295));
  24. print(m2(4294967295));
  25. print(m2(4294967295));