forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicMathOp.js
More file actions
30 lines (28 loc) · 883 Bytes
/
BasicMathOp.js
File metadata and controls
30 lines (28 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function module(stdlib)
{
"use asm"
var fr = stdlib.Math.fround;
function foo()
{
var s = fr(10.5);
var i = fr(20);
var g = fr(30);
var h = fr(42.42);
var j = fr(19.5);
var c = 125.5
i = fr(s - i);
g = fr(g/s);
c = +j;
h = fr(s*h);
s = fr(+j);
return fr(fr(s + i) +fr( g + h ));
}
return foo;
}
var x = module({Math:Math});
WScript.Echo(x());
WScript.Echo(x());