use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testExpm1.
@Test(description = "Test 'expm1' function in ballerina.lang.math package")
public void testExpm1() {
BValue[] args = { new BFloat(0.5) };
BValue[] returns = BRunUtil.invoke(compileResult, "expm1Test", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 0.6487212707001282, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testLog.
@Test(description = "Test 'log' function in ballerina.lang.math package")
public void testLog() {
BValue[] args = { new BFloat(60984.1) };
BValue[] returns = BRunUtil.invoke(compileResult, "logTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 11.018368453441132, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testSignum.
@Test(description = "Test 'signum' function in ballerina.lang.math package")
public void testSignum() {
BValue[] args = { new BFloat(50.14) };
BValue[] returns = BRunUtil.invoke(compileResult, "signumTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 1.0, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testMathPow.
@Test(description = "Test 'pow' function in ballerina.lang.math package")
public void testMathPow() {
BValue[] args = { new BFloat(5.0), new BFloat(5.0) };
BValue[] returns = BRunUtil.invoke(compileResult, "powTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 3125.0, DELTA);
}
use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.
the class MathTest method testHypot.
@Test(description = "Test 'hypot' function in ballerina.lang.math package")
public void testHypot() {
BValue[] args = { new BFloat(60984.1), new BFloat(-497.99) };
BValue[] returns = BRunUtil.invoke(compileResult, "hypotTest", args);
Assert.assertEquals(returns.length, 1);
Assert.assertEquals(((BFloat) returns[0]).floatValue(), 60986.133234122164, DELTA);
}
Aggregations