use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testNextDown.
@Test(description = "Test 'nextDown' function in ballerina.lang.math package")
public void testNextDown() {
BValue[] args = { new BFloat(60984.1) };
BValue[] returns = BRunUtil.invoke(compileResult, "nextDownTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 60984.09999999999, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testLog1p.
@Test(description = "Test 'log1p' function in ballerina.lang.math package")
public void testLog1p() {
BValue[] args = { new BFloat(1000) };
BValue[] returns = BRunUtil.invoke(compileResult, "log1pTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 6.90875477931522, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testSin.
@Test(description = "Test 'sin' function in ballerina.lang.math package")
public void testSin() {
BValue[] args = { new BFloat(0.7853981633974483) };
BValue[] returns = BRunUtil.invoke(compileResult, "sinTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 0.7071067811865475, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testRint.
@Test(description = "Test 'rint' function in ballerina.lang.math package")
public void testRint() {
BValue[] args = { new BFloat(2.50) };
BValue[] returns = BRunUtil.invoke(compileResult, "rintTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 2.0, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testNextUp.
@Test(description = "Test 'nextUp' function in ballerina.lang.math package")
public void testNextUp() {
BValue[] args = { new BFloat(-100.675) };
BValue[] returns = BRunUtil.invoke(compileResult, "nextUpTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), -100.67499999999998, DELTA);
}
Aggregations