2
0
Эх сурвалжийг харах

[python] use Math.round instead of own function

Dan Korostelev 11 жил өмнө
parent
commit
34849cc8d7
1 өөрчлөгдсөн 1 нэмэгдсэн , 5 устгасан
  1. 1 5
      std/python/Boot.hx

+ 1 - 5
std/python/Boot.hx

@@ -88,10 +88,6 @@ private class ClassRegistry extends python.lib.Dict<String, HxClassBase> {
 @:preCode("_hx_classes = _hx_ClassRegistry()")
 @:keep class Boot {
 
-	static inline function mathRound (v:Float) {
-		return Math.floor(v + 0.5);
-	}
-
 	static var keywords:Set<String> = new Set(
 	[
 		"and",      "del",      "from",     "not",      "while",
@@ -186,7 +182,7 @@ private class ClassRegistry extends python.lib.Dict<String, HxClassBase> {
 		if (isPyFloat(o)) {
 			try {
 				if ( (o:Float) == builtinInt(o)) {
-					return builtinStr(mathRound(o));
+					return builtinStr(Math.round(o));
 				} else {
 					return builtinStr(o);
 				}