2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-24 19:04:02 +08:00

language/core: add round64

This commit is contained in:
Sebastien Bourdeauducq 2014-08-16 23:18:56 +08:00
parent 02798d1996
commit 71825f5ae0

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))