Scalar Operations APIs#

ISNAN#

group isnan

Functions

template<typename T>
logical isnan(T *sin)#

ISNAN tests input for NaN.

Purpose:

 ISNAN   returns .TRUE. if its argument is NaN, and .FALSE.
 otherwise.  To be replaced by the Fortran 2003 intrinsic in the
 future.

Parameters:

SIN – [in]

SIN is REAL

Input to test for NaN.

Returns:

LOGICAL Boolean. Return TRUE if argument is NAN.

LAISNAN#

group laisnan

Functions

template<typename T>
logical laisnan(real *sin1, real *sin2)#

LAISNAN 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 ISNAN.

 LAISNAN 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.

Parameters:
  • SIN1 – [in] SIN1 is REAL

  • SIN2 – [in]

    SIN2 is REAL

    Two numbers to compare for inequality.

Returns:

LOGICAL Boolean. Return TRUE if argument is NAN.

LADIV#

group ladiv

Functions

template<typename T>
void ladiv(T *a, T *b, T *c, T *d, T *p, T *q)#

LADIV performs complex division in real arithmetic, avoiding unnecessary overflow.

Purpose:

 LADIV performs complex division in  real arithmetic

                       a + i*b
            p + i*q = ---------
                       c + i*d

 The algorithm is due to Michael Baudin and Robert L. Smith
 and can be found in the paper
 "A Robust Complex Division in Scilab"

Parameters:
  • A – [in] A is REAL

  • B – [in] B is REAL

  • C – [in] C is REAL

  • D – [in]

    D is REAL

    The scalars a, b, c, and d in the above expression.

  • P – [out] P is REAL

  • Q – [out]

    Q is REAL

    The scalars p and q in the above expression.

LAPY2#

group lapy2

Functions

template<typename T>
T lapy2(T *x, T *y)#

LAPY2 returns sqrt(x2+y2)

Purpose:

  LAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary
  overflow.

Parameters:
  • X – [in] X is REAL

  • Y – [in]

    Y is REAL

    X and Y specify the values x and y.

Returns:

T Template based return value of the function.

LAPY3#

group lapy3

Functions

template<typename T>
T lapy3(T *x, T *y, T *z)#

LAPY3 returns sqrt(x2+y2+z2)

Purpose:

  LAPY3 returns sqrt(x**2+y**2+z**2), taking care not to cause
  unnecessary overflow.

Parameters:
  • X – [in] X is REAL

  • Y – [in] Y is REAL

  • Z – [in]

    Z is REAL

    X, Y and Z specify the values x, y and z.

Returns:

T Template based return value of the function.