laisnan(3)

πŸ’… laisnan(3) β€” the "test for NaN, unoptimized" bestie

okay so this is laisnan from the Library Functions Manual, and if you're here it's because something in your numerical life is being weird and you need to know whether a float is literally Not A Number. no cap. buckle up πŸŽ€


✨ NAME ✨

laisnan β€” laisnan: test for NaN, unoptimized

like, yes, that's the whole name. it's giving "function that knows what it is." πŸ’β€β™€οΈ


🌸 SYNOPSIS 🌸

Functions

  • logical function dlaisnan (din1, din2) β€” DLAISNAN tests input for NaN by comparing two arguments for inequality.
  • logical function slaisnan (sin1, sin2) β€” SLAISNAN tests input for NaN by comparing two arguments for inequality.

πŸ¦‹ Detailed Description πŸ¦‹

so here's the thing bestie β€” this page is basically a Documentation section followed by all the Function Documentation. we're gonna go through it together, one function at a time. no skipping. 🫢


πŸ‘‘ Function Documentation πŸ‘‘

πŸ’œ logical function dlaisnan (double precision, intent(in) din1, double precision, intent(in) din2)

DLAISNAN tests input for NaN by comparing two arguments for inequality.

πŸŽ€ Purpose:

!>
!> This routine is not for general use.  It exists solely to avoid
!> over-optimization in DISNAN.
!>
!> DLAISNAN checks for NaNs by comparing its two arguments for
!> inequality.  NaN is the only floating-point value where NaN != NaN
!> returns .TRUE.  To check for NaNs, pass the same variable as both
!> arguments.
!>
!> A compiler must assume that the two arguments are
!> not the same variable, and the test will not be optimized away.
!> Interprocedural or whole-program optimization may delete this
!> test.  The ISNAN functions will be replaced by the correct
!> Fortran 03 intrinsic once the intrinsic is widely available.
!>
bestie, listen to me: this routine is not for general use. it exists solely to avoid over-optimization in DISNAN. do not go using it for random stuff, i'm begging πŸ™ˆ

the trick is iconic honestly β€” NaN is the only floating-point value where NaN != NaN returns .TRUE.. so to check for NaNs, you pass the same variable as both arguments. that's the whole move. ✨

and the compiler has to assume the two arguments are not the same variable, so the test will not be optimized away. cute, right? but ⚠️ interprocedural or whole-program optimization may delete this test β€” she's a little fragile, okay, don't come for her.

also, the ISNAN functions will be replaced by the correct Fortran 03 intrinsic once the intrinsic is widely available. so this whole thing is lowkey a temporary era and we respect it. πŸ’…

Parameters

  • DIN1
!>          DIN1 is DOUBLE PRECISION
!>
  • DIN2
!>          DIN2 is DOUBLE PRECISION
!>          Two numbers to compare for inequality.
!>

so yeah β€” two DOUBLE PRECISION numbers to compare for inequality. and remember, to actually test, they should be the same variable. make it make sense, it does. 🧚

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 73 of file dlaisnan.f.


🌈 logical function slaisnan (real, intent(in) sin1, real, intent(in) sin2)

SLAISNAN tests input for NaN by comparing two arguments for inequality.

⭐ Purpose:

!>
!> This routine is not for general use.  It exists solely to avoid
!> over-optimization in SISNAN.
!>
!> SLAISNAN checks for NaNs by comparing its two arguments for
!> inequality.  NaN is the only floating-point value where NaN != NaN
!> returns .TRUE.  To check for NaNs, pass the same variable as both
!> arguments.
!>
!> A compiler must assume that the two arguments are
!> not the same variable, and the test will not be optimized away.
!> Interprocedural or whole-program optimization may delete this
!> test.  The ISNAN functions will be replaced by the correct
!> Fortran 03 intrinsic once the intrinsic is widely available.
!>

same energy, single precision edition. this one exists solely to avoid over-optimization in SISNAN β€” not for general use, periodt. 🎯

again: NaN is the only floating-point value where NaN != NaN returns .TRUE., so pass the same variable as both arguments to check for NaNs. the compiler must assume the two arguments are not the same variable, so the test won't be optimized away β€” but ⚠️ interprocedural or whole-program optimization may delete this test, so heads up fr fr.

and yeah, the ISNAN functions will be replaced by the correct Fortran 03 intrinsic once the intrinsic is widely available. icon behavior, honestly. 🌟

Parameters

  • SIN1
!>          SIN1 is REAL
!>
  • SIN2
!>          SIN2 is REAL
!>          Two numbers to compare for inequality.
!>

two REAL numbers to compare for inequality, bestie. that's it, that's the whole vibe check. πŸ“

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 73 of file slaisnan.f.


🫢 Author 🫢

Generated automatically by Doxygen for LAPACK from the source code.

(so nobody hand-wrote this one, a robot did it. still ate though. πŸ’€βœ¨)


πŸ’– and that's the page!! full transparency: this whole thing is auto-generated by Doxygen for LAPACK straight from the source code, and it's stamped LAPACK Version 3.12.0, with laisnan(3) right there in the corner. mwah, bye bestie πŸ‘‘πŸŒΈ
πŸ“¦ where this page comes from