use of io.nuls.contract.vm.Result in project nuls by nuls-io.
the class NativeCharacter method digit.
/**
* override
*
* @see Character#digit(int, int)
*/
private static Result digit(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
int codePoint = (int) methodArgs.invokeArgs[0];
int radix = (int) methodArgs.invokeArgs[1];
int i = Character.digit(codePoint, radix);
Result result = NativeMethod.result(methodCode, i, frame);
return result;
}
use of io.nuls.contract.vm.Result in project nuls by nuls-io.
the class NativeDouble method parseDouble.
/**
* override
*
* @see Double#parseDouble(String)
*/
private static Result parseDouble(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
ObjectRef objectRef = (ObjectRef) methodArgs.invokeArgs[0];
String s = frame.heap.runToString(objectRef);
double d;
try {
d = Double.parseDouble(s);
} catch (Exception e) {
frame.throwNumberFormatException(e.getMessage());
return null;
}
Result result = NativeMethod.result(methodCode, d, frame);
return result;
}
use of io.nuls.contract.vm.Result in project nuls by nuls-io.
the class NativeDouble method toString.
/**
* override
*
* @see Double#toString(double)
*/
private static Result toString(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
double d = (double) methodArgs.invokeArgs[0];
String s = Double.toString(d);
ObjectRef ref = frame.heap.newString(s);
Result result = NativeMethod.result(methodCode, ref, frame);
return result;
}
use of io.nuls.contract.vm.Result in project nuls by nuls-io.
the class NativeDouble method doubleToRawLongBits.
/**
* native
*
* @see Double#doubleToRawLongBits(double)
*/
private static Result doubleToRawLongBits(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
double value = (double) methodArgs.invokeArgs[0];
long bits = Double.doubleToRawLongBits(value);
Result result = NativeMethod.result(methodCode, bits, frame);
return result;
}
use of io.nuls.contract.vm.Result in project nuls by nuls-io.
the class NativeFloat method floatToRawIntBits.
/**
* native
*
* @see Float#floatToRawIntBits(float)
*/
private static Result floatToRawIntBits(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
float value = (float) methodArgs.invokeArgs[0];
int bits = Float.floatToRawIntBits(value);
Result result = NativeMethod.result(methodCode, bits, frame);
return result;
}
Aggregations