Added floating point modulus function
This commit is contained in:
@@ -96,6 +96,45 @@ fun sin(arg: double): double
|
|||||||
return ans;
|
return ans;
|
||||||
}//end sin function
|
}//end sin function
|
||||||
|
|
||||||
//|int| NotPi = 3;
|
fun mod(x: double, y: double): double
|
||||||
//|double| STD_PI = 4*atan(1);
|
{
|
||||||
|
var ans: double;
|
||||||
|
var intAns: int;
|
||||||
|
|
||||||
|
intAns = x / y;
|
||||||
|
ans = x - intAns*y;
|
||||||
|
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user