---
title: mathMode
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcompileoptions/mathmode
---

# mathMode

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

## Declaration

```swift
var mathMode: MTLMathMode { get set }
```

## Discussion

Discussion This property replaces the fastMathEnabled property. If fastMathEnabled is true, the system sets mathMode to MTLMathMode.fast and mathFloatingPointFunctions to MTLMathFloatingPointFunctions.fast. If fastMathEnabled is false, the system sets mathMode to MTLMathMode.safe and mathFloatingPointFunctions to MTLMathFloatingPointFunctions.precise. Subsequent calls to mathMode or mathFloatingPointFunctions set the variables directly.

## Topics

### Supporting types

- [MTLMathMode](metal/mtlmathmode.md)

## See Also

### Configuring the compiler options

- [enableLogging](metal/mtlcompileoptions/enablelogging.md)
- [mathFloatingPointFunctions](metal/mtlcompileoptions/mathfloatingpointfunctions.md)
- [preserveInvariance](metal/mtlcompileoptions/preserveinvariance.md)
- [languageVersion](metal/mtlcompileoptions/languageversion.md)
- [preprocessorMacros](metal/mtlcompileoptions/preprocessormacros.md)
- [optimizationLevel](metal/mtlcompileoptions/optimizationlevel.md)
- [libraries](metal/mtlcompileoptions/libraries.md)
- [fastMathEnabled](metal/mtlcompileoptions/fastmathenabled.md)
