Explorar el Código

Update builtins.h

blueloveTH hace 3 años
padre
commit
2192941bc8
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      src/builtins.h

+ 6 - 0
src/builtins.h

@@ -146,6 +146,12 @@ class dict:
             a.append(k.__json__()+': '+v.__json__())
             a.append(k.__json__()+': '+v.__json__())
         return '{'+ ', '.join(a) + '}'
         return '{'+ ', '.join(a) + '}'
 
 
+def round(x):
+    if x >= 0:
+        return int(x + 0.5)
+    else:
+        return int(x - 0.5)
+
 def max(a, b):
 def max(a, b):
     if a > b:
     if a > b:
         return a
         return a