Build a 0-D MLX array holding v cast to dt.
Used as a broadcastable RHS in arithmetic helpers (e.g. x + 1)
to avoid materialising a same-shape constant tensor. The literal
flows into the kernel inline, paying zero allocation cost.
Parameters
vdoubleScalar value to embed. Cast to
float before MLX construction.dtmlx::core::DtypeFinal MLX dtype the scalar should be cast to.
Returns
mlx::core::arrayA rank-0 MLX array of dtype dt holding v.
Notes
The intermediate float cast loses precision for very large double-precision values; callers needing exact int64 broadcasts should construct the array directly.