toFloat (Function)
Signature: toFloat(value: int) -> float
Description: Widens an int to a float, rounding to nearest even. Exact for magnitudes up to 2^53. Total, so it returns a bare float rather than a Result. This is the explicit element conversion GPU kernels use; there is no implicit widening at a buffer boundary.
Parameters
- value (int): The integer to widen
Returns: float
Example
let xs = gpuIota(1000) |> gpuMap(toFloat) // a float buffer 0.0 .. 999.0
xs = gpuIota 1000 |> gpuMap toFloat // a float buffer 0.0 .. 999.0