---
title: math.is_nan
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/floating-point-classifications/math-is-nan
---

```
BOOL math.is_nan(FLOAT x)
```

**Available in:** all subroutines

Determines whether a floating point value is NaN (Not a Number).
See [floating point classifications](https://www.fastly.com/documentation/reference/vcl/functions/floating-point-classifications/) for
more information.

## Example

```vcl
declare local var.f FLOAT;

set var.f = 1;
set var.f /= 0;
if (math.is_nan(var.f)) {
  log "division by zero";
}
```
