IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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:

Returns:

Bool: True if at least one lane equals the sentinel, False otherwise.

Was this page helpful?