floatmod.js 707 B

1234567891011121314151617181920
  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 AsmModuleFloat(stdlib) {
  6. "use asm";
  7. var fround = stdlib.Math.fround;
  8. function rem(x,y) {
  9. x = fround(x);
  10. y = fround(y);
  11. return fround(x%y);
  12. }
  13. return {
  14. rem : rem,
  15. };
  16. }
  17. var asmModuleFloat = AsmModuleFloat({Math:Math});
  18. print(asmModuleFloat.rem(1,1));