float32 (Function)

Signature: float32(x: float) -> float

Description: Rounds a float to the nearest binary32 (ties to even) and widens back: the value a float32 pipeline holds. Total and pure, so a kernel may call it or name it.

Parameters

  • x (float): The double to narrow

Returns: float

Example

print(float32(0.1))  // 0.10000000149011612
print (float32 0.1)  // 0.10000000149011612