Skip to content

Instantly share code, notes, and snippets.

@athas
Created January 20, 2021 12:47
Show Gist options
  • Save athas/0c1c34772f0093c0401e88f6287569b2 to your computer and use it in GitHub Desktop.
Save athas/0c1c34772f0093c0401e88f6287569b2 to your computer and use it in GitHub Desktop.
let isnan32 (x: f32) =
let x = f32.to_bits x
let exponent = (x >> 23) & 0b11111111
let significand = x & 0b11111111111111111111111
in exponent == 0b11111111 && significand != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment