Search in sources :

Example 56 with BFloat

use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.

the class Atan2 method execute.

public void execute(Context ctx) {
    double a = ctx.getFloatArgument(0);
    double b = ctx.getFloatArgument(1);
    ctx.setReturnValues(new BFloat(Math.atan2(a, b)));
}
Also used : BFloat(org.ballerinalang.model.values.BFloat)

Example 57 with BFloat

use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.

the class Cbrt method execute.

public void execute(Context ctx) {
    double value = ctx.getFloatArgument(0);
    ctx.setReturnValues(new BFloat(Math.cbrt(value)));
}
Also used : BFloat(org.ballerinalang.model.values.BFloat)

Example 58 with BFloat

use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.

the class Cosh method execute.

public void execute(Context ctx) {
    double value = ctx.getFloatArgument(0);
    ctx.setReturnValues(new BFloat(Math.cosh(value)));
}
Also used : BFloat(org.ballerinalang.model.values.BFloat)

Example 59 with BFloat

use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.

the class Scalb method execute.

public void execute(Context ctx) {
    double a = ctx.getFloatArgument(0);
    long b = ctx.getIntArgument(0);
    int intVal = ((Long) b).intValue();
    ctx.setReturnValues(new BFloat(Math.scalb(a, intVal)));
}
Also used : BFloat(org.ballerinalang.model.values.BFloat)

Example 60 with BFloat

use of org.ballerinalang.model.values.BFloat in project ballerina by ballerina-lang.

the class AbsFloat method execute.

public void execute(Context ctx) {
    double value = ctx.getFloatArgument(0);
    ctx.setReturnValues(new BFloat(Math.abs(value)));
}
Also used : BFloat(org.ballerinalang.model.values.BFloat)

Aggregations

BFloat (org.ballerinalang.model.values.BFloat)158 BValue (org.ballerinalang.model.values.BValue)119 Test (org.testng.annotations.Test)107 BInteger (org.ballerinalang.model.values.BInteger)55 BString (org.ballerinalang.model.values.BString)41 BBoolean (org.ballerinalang.model.values.BBoolean)21 BRefType (org.ballerinalang.model.values.BRefType)7 BStruct (org.ballerinalang.model.values.BStruct)7 BType (org.ballerinalang.model.types.BType)6 BBlob (org.ballerinalang.model.values.BBlob)6 BStringArray (org.ballerinalang.model.values.BStringArray)5 BStructType (org.ballerinalang.model.types.BStructType)4 BIntArray (org.ballerinalang.model.values.BIntArray)4 UnsupportedFieldTypeException (org.ballerinalang.net.grpc.exception.UnsupportedFieldTypeException)4 BallerinaException (org.ballerinalang.util.exceptions.BallerinaException)4 BJSON (org.ballerinalang.model.values.BJSON)3 CompileResult (org.ballerinalang.launcher.util.CompileResult)2 BMap (org.ballerinalang.model.values.BMap)2 BRefValueArray (org.ballerinalang.model.values.BRefValueArray)2 Message (org.ballerinalang.net.grpc.Message)2