From 2192941bc83dd8baff5f85e18a09390b6215b720 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 13 Nov 2022 21:09:56 +0800 Subject: [PATCH] Update builtins.h --- src/builtins.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/builtins.h b/src/builtins.h index 4766e2d4..f08def79 100644 --- a/src/builtins.h +++ b/src/builtins.h @@ -146,6 +146,12 @@ class dict: a.append(k.__json__()+': '+v.__json__()) return '{'+ ', '.join(a) + '}' +def round(x): + if x >= 0: + return int(x + 0.5) + else: + return int(x - 0.5) + def max(a, b): if a > b: return a