Skip to main content

IAR Embedded Workbench for RISC-V 3.40

__fp_classNN

In this section:
Syntax
unsigned int __fp_class32(float);
unsigned int __fp_class64(double);
Description

Classifies a floating-point value, using the instruction fclass.s (32-bit FPU) or fclass.d (64-bit FPU). A compatible FPU must be available.

A bit mask with exactly one bit set is returned. The possible values are:

_FP_NEGATIVE_INF

Negative infinity

_FP_NEGATIVE_NORMAL

Negative normal number

_FP_NEGATIVE_SUBNORMAL

Negative subnormal number

_FP_NEGATIVE_ZERO

Negative zero

_FP_POSITIVE_INF

Positive infinity

_FP_POSITIVE_NORMAL

Positive normal number

_FP_POSITIVE_SUBNORMAL

Positive subnormal number

_FP_POSITIVE_ZERO

Positive zero

_FP_SIGNALING_NAN

Signaling NaN

_FP_QUIET_NAN

Quiet NaN

Example
if (  __fp_class32(value)
    & (  _FP_NEGATIVE_SUBNORMAL
       | _FP_POSITIVE_SUBNORMAL))
{
  /* value is subnormal */
}

Note

To use intrinsic functions in an application, you must include the header file(s) where they are declared, see Summary of intrinsic functions.