From 71825f5ae01c8dd8f817b5398591a0cf08f1eced Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 16 Aug 2014 23:18:56 +0800 Subject: [PATCH] language/core: add round64 --- artiq/language/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artiq/language/core.py b/artiq/language/core.py index 16a404df2..da4924661 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -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))