瀏覽代碼

document Math.round tie behaviour (closes #5447)

Dan Korostelev 9 年之前
父節點
當前提交
6d422f34fa
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      std/Math.hx

+ 4 - 0
std/Math.hx

@@ -205,6 +205,8 @@ extern class Math
 	/**
 		Rounds `v` to the nearest integer value.
 
+		Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`.
+
 		If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY`
 		or `POSITIVE_INFINITY`, the result is unspecified.
 	**/
@@ -252,6 +254,8 @@ extern class Math
 	/**
 		Rounds `v` to the nearest integer value, as a Float.
 
+		Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`.
+
 		If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`,
 		the result is unspecified.
 	**/