For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
has_neg_zero
def has_neg_zero[dtype: DType, width: Int](v: SIMD[dtype, width]) -> Bool
Returns True if any lane of v holds the -0.0 sentinel bit pattern.
This is the consumer-side readiness poll: a pack that still contains a sentinel lane has not been fully written by the producer. The any-lane reduction also defends against a torn read that leaves a single sentinel lane behind a partially-visible store.
Parameters:
- โdtype (
DType): The transport float type. Must be bfloat16, float16, or float32. - โwidth (
Int): The SIMD pack width.
Args:
- โv (
SIMD[dtype, width]): The pack to test.
Returns:
Bool: True if at least one lane equals the sentinel, False otherwise.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!