round (Function)

Signature: round(x: float) -> float

Description: The nearest integer to x, as a float, with halfway cases rounded to even — Python's round and numpy's rounding, not C's half-away-from-zero. Total.

Parameters

  • x (float): The float to round

Returns: float

Example

print("${round(2.5)},${round(3.5)}")  // 2.0,4.0
print "${round(2.5)},${round(3.5)}"  // 2.0,4.0