<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLMathMode",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLMathMode"
  },
  "title" : "MTLMathMode"
}
-->

# MTLMathMode

An indication of whether the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard.

```
enum MTLMathMode
```

## Topics

### Modes

[`MTLMathMode.fast`](/documentation/Metal/MTLMathMode/fast)

An indicator of the mode the compiler uses to make aggressive, potentially lossy assumptions about floating-point math.

[`MTLMathMode.relaxed`](/documentation/Metal/MTLMathMode/relaxed)

An indicator of the mode the compiler uses to make aggressive, potentially lossy assumptions about floating-point math, while honoring Inf/NaN.

[`MTLMathMode.safe`](/documentation/Metal/MTLMathMode/safe)

An indicator of the mode the compiler uses to disable unsafe floating-point optimizations by preventing the compiler from making any transformations that could affect the results.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)