language/core: add round64

This commit is contained in:
Sebastien Bourdeauducq 2014-08-16 23:18:56 +08:00
parent 02798d1996
commit 71825f5ae0
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ for _op_name in (
op_method = getattr(int, "__" + _op_name + "__")
setattr(int64, "__i" + _op_name + "__", _make_int64_op_method(op_method))
def round64(x):
return int64(round(x))
def _make_kernel_ro(value):
return isinstance(value, (int, float, str, units.Quantity))