Pārlūkot izejas kodu

document Math.round tie behaviour (closes #5447)

Dan Korostelev 9 gadi atpakaļ
vecāks
revīzija
6d422f34fa
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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.
 	**/