Align complex64 finfo with NumPy#1
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the DType enum in Source/MLX/DType.swift to group the .complex64 case with .float32 instead of .float64 when determining floating-point properties such as ulpOfOne, greatestFiniteMagnitude, leastNormalMagnitude, and leastNonzeroMagnitude. This correctly reflects that a 64-bit complex number is composed of two 32-bit float components. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Proposed changes
complex64 is a single-precision complex type with
float32components, sonumpy.finfo(numpy.complex64)returnsfloat32limits. In the SwiftFInfoimplementation,.complex64was grouped with.float64, which surfaced double-precision valuesChecklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes