Type coercion for luajava package, make luajava an "addon"
This commit is contained in:
@@ -40,7 +40,7 @@ public class LDouble extends LNumber {
|
||||
case Lua.OP_MUL: return new LDouble( lhs * rhs );
|
||||
case Lua.OP_DIV: return new LDouble( lhs / rhs );
|
||||
case Lua.OP_MOD: return new LDouble( lhs % rhs );
|
||||
case Lua.OP_POW: return new LDouble( Math.pow(lhs, rhs) );
|
||||
// case Lua.OP_POW: return new LDouble( Math.pow(lhs, rhs) );
|
||||
}
|
||||
return luaUnsupportedOperation();
|
||||
}
|
||||
@@ -49,6 +49,10 @@ public class LDouble extends LNumber {
|
||||
return (int) m_value;
|
||||
}
|
||||
|
||||
public double luaAsDouble() {
|
||||
return m_value;
|
||||
}
|
||||
|
||||
// binary compares on integers, first dispatch
|
||||
public boolean luaBinCmpUnknown(int opcode, LValue lhs) {
|
||||
return lhs.luaBinCmpDouble( opcode, this.m_value );
|
||||
|
||||
Reference in New Issue
Block a user