📄 SEGGER Linker User Guide & Reference Manual
📄 SEGGER Runtime Library User Guide & Reference Manual
📄 AppWizard User Guide & Reference Manual
📄 embOS & embOS-MPU User Guide & Reference Manual
📄 emCompress-Embed User Guide & Reference Manual
📄 emCompress-Flex User Guide & Reference Manual
📄 emCompress-ToGo User Guide & Reference Manual
📄 emCrypt User Guide & Reference Manual
📄 emDropbox User Guide & Reference Manual
📄 emFile User Guide & Reference Manual
📄 emNet User Guide & Reference Manual
📄 emSecure-ECDSA User Guide & Reference Manual
📄 emSecure-RSA User Guide & Reference Manual
📄 emSSH User Guide & Reference Manual
📄 emSSL User Guide & Reference Manual
📄 emUSB-Device User Guide & Reference Manual
📄 emUSB-Host User Guide & Reference Manual
📄 emWeb User Guide & Reference Manual
📄 emWin User Guide & Reference Manual
📄 IoT Toolkit User Guide & Reference Manual
📄 SEGGER Assembler User Guide & Reference Manual
📄 SEGGER Floating-point Library User Guide & Reference Manual

SEGGER Floating-point Library User Guide & Reference Manual

A floating-point library for microcontrollers.

Introduction

This section presents an overview of SEGGER Floating-point Library, its structure, and its capabilities.

What is the SEGGER Floating-point Library?

SEGGER Floating-point Library is an optimized C and assembly language library to implement common floating-point operations on Arm and RISC-V processors.

Features

SEGGER Floating-point Library is written in standard ANSI C and Arm and RISC-V assembly language and can run on any Arm or RV32I CPU. Here’s a list summarising the main features of SEGGER Floating-point Library:

We recommend keeping SEGGER Floating-point Library separate from your application files. It is good practice to keep all the program files (including the header files) together in the LIB subdirectory of your project’s root directory. This practice has the advantage of being very easy to update to newer versions of SEGGER Floating-point Library by simply replacing the LIB directory. Your application files can be stored anywhere.

Note

When updating to a newer SEGGER Floating-point Library version: as files may have been added, moved or deleted, the project directories may need to be updated accordingly.

Package content

SEGGER Floating-point Library is provided in source code and contains everything needed. The following table shows the content of the SEGGER Floating-point Library Package:

Directory Description
Doc SEGGER Floating-point Library documentation.
LIB SEGGER Floating-point Library source code.

Include directories

You should make sure that the system include path contains the following directory:

Note

Always make sure that you have only one version of each file!

It is frequently a major problem when updating to a new version of SEGGER Floating-point Library if you have old files included and therefore mix different versions. If you keep SEGGER Floating-point Library in the directories as suggested (and only in these), this type of problem cannot occur. When updating to a newer version, you should be able to keep your configuration files and leave them unchanged. For safety reasons, we recommend backing up (or at least renaming) the LIB directories before to updating.

Compiling the SEGGER Floating-point Library

User-facing source files

The standard C library is exposed to the user by a set of header files that provide an interface to the library. In addition, there must be additional “invisible” functions added to provide C language support, such as software floating point and integer mathematics, that the C compiler calls.

The user-facing interface files are:

File Description
__SEGGER_RTL_FP.h Interface to the SEGGER floating-point library.

In addition some private header files are required:

File Description
__SEGGER_RTL_FP_Conf.h Configuration of the library.
__SEGGER_RTL_FP_ConfDefaults.h Default configuration of the library.

Implementation source files

SEGGER Floating-point Library is delivered in a small number of files that must be added to your project before building:

File Description
floatops.c Support for high-level floating point functions.
floatasmops_arm.s Support for low-level floating point functions (ARM).
floatasmops_rv.s Support for low-level floating point functions (RISC-V).

Configuring the library

All source files should be added to the project and the following preprocessor symbols set correctly to select the particular variant of the library:

Symbol Description
__SEGGER_RTL_BYTE_ORDER Select the target’s byte order.
__SEGGER_RTL_OPTIMIZE Prefer size-optimized or speed-optimized code.

In many cases these can be configured automatically. For ARM the default configuration of the library is derived from these preprocessor symbols:

Symbol Description
__thumb__ Assemble targeting the Thumb instruction set (as opposed to ARM).
__thumb2__ Assemble targeting the Thumb-2 instruction set.
__ARCH_V3 Assemble targeting ARMv3.
__ARCH_V4 Assemble targeting ARMv4.
__ARCH_V4T Assemble targeting ARMv4T.
__ARCH_V5TE Assemble targeting for ARMv5TE.
__ARCH_V6M Assemble targeting for ARMv6-M.
__ARCH_V7M Assemble targeting for ARMv7-M.
__ARCH_V7EM Assemble targeting for ARMv7E-M.
__FP_ABI_HARD__ Assemble targeting the hard floating point ABI.
__FPU_VFP__ Assemble targeting the vector FPU.
__FPV4_SP_D16__ Assemble targeting the single-precision v4 FPU.
__FPV5_SP_D16__ Assemble targeting the single-precision v5 FPU.
__LITTLE_ENDIAN Target little-endian processors.
__BIG_ENDIAN Target big-endian processors.

For RISC-V the default configuration of the library is derived from these preprocessor symbols:

Symbol Description
__riscv Target is RISC-V.
__riscv_abi_rve Assemble targeting RV32E.
__riscv_compressed Target has C extension.
__riscv_float_abi_soft Target has neither F nor D extension.
__riscv_float_abi_single Target has F extension.
__riscv_float_abi_double Target has D and F extensions.
__riscv_mul Target has M extension.
__riscv_muldiv Target has M extension with divide support.
__riscv_xlen Distinguish RV32 and RV64 targets.

The SEGGER Runtime Library configuration file

The configuration of SEGGER Floating-point Library is defined by the content of __libc_conf.h which is included by all C and assembly language source files.

__SEGGER_RTL_BYTE_ORDER

Set this to -1 for little-endian byte order and +1 for big-endian byte order.

Note

This library does not support big-endian RVI32 targets

__SEGGER_RTL_OPTIMIZE

Define the preprocessor symbol __SEGGER_RTL_OPTIMIZE to select size-optimized implementations for both C and assembly language code.

If this preprocessor symbol is undefined (the default) the library is configured to select balanced implementations.

Value Description
-2 Favor size at the expense of speed.
-1 Favor size over speed.
0 Balanced.
+1 Favor speed over size.
+2 Favor speed at the expense of size.
+3 As +2 and inline all functions that make sense as inlined.

Example command lines for compilation

The following GCC command lines a re sufficient to build the floating-point library for RV32IMAC with an ILP32 ABI, assuming gcc is the compiler driver:

gcc -mabi=ilp32 -march=rv32imac -c -x assembler-with-cpp floatasmops_rv.s
gcc -mabi=ilp32 -march=rv32imac -c -O3 floatops.c

Standard C library API

Exponential and logarithm functions

Function Description
sqrt() Compute square root, double.
sqrtf() Compute square root, float.
cbrt() Compute cube root, double.
cbrtf() Compute cube root, float.
exp() Compute base-e exponential, double.
expf() Compute base-e exponential, float.
exp2() Compute base-2 exponential, double.
exp2f() Compute base-2 exponential, float.
exp10() Compute base-10 exponential, double.
exp10f() Compute base-10 exponential, float.
expm1f() Compute base-e exponential, modified, double.
frexp() Set exponent, double.
frexpf() Set exponent, float.
hypot() Compute magnitude of complex, double.
hypotf() Compute magnitude of complex, float.
log() Compute natural logarithm, double.
logf() Compute natural logarithm, float.
log10() Compute common logarithm, double.
log10f() Compute common logarithm, float.
ldexp() Scale by power of two, double.
ldexpf() Scale by power of two, float.
pow() Raise to power, double.
powf() Raise to power, float.
scalbn() Scale, double.
scalbnf() Scale, float.

sqrt()

Description

Compute square root, double.

Prototype

double sqrt(double x);

Parameters

Parameter Description
x Value to compute square root of.

Return value

Additional information

sqrt() computes the nonnegative square root of x. C90 and C99 require that a domain error occurs if the argument is less than zero, sqrt() deviates and always uses IEC 60559 semantics.

sqrtf()

Description

Compute square root, float.

Prototype

float sqrtf(float x);

Parameters

Parameter Description
x Value to compute square root of.

Return value

Additional information

sqrt() computes the nonnegative square root of x. C90 and C99 require that a domain error occurs if the argument is less than zero, sqrt() deviates and always uses IEC 60559 semantics.

cbrt()

Description

Compute cube root, double.

Prototype

double cbrt(double x);

Parameters

Parameter Description
x Value to compute cube root of.

Return value

cbrtf()

Description

Compute cube root, float.

Prototype

float cbrtf(float x);

Parameters

Parameter Description
x Value to compute cube root of.

Return value

exp()

Description

Compute base-e exponential, double.

Prototype

double exp(double x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

expf()

Description

Compute base-e exponential, float.

Prototype

float expf(float x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

exp2()

Description

Compute base-2 exponential, double.

Prototype

double exp2(double x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

exp2f()

Description

Compute base-2 exponential, float.

Prototype

float exp2f(float x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

exp10()

Description

Compute base-10 exponential, double.

Prototype

double exp10(double x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

exp10f()

Description

Compute base-10 exponential, float.

Prototype

float exp10f(float x);

Parameters

Parameter Description
x Value to compute base-e exponential of.

Return value

expm1f()

Description

Compute base-e exponential, modified, double.

Prototype

float expm1f(float x);

Parameters

Parameter Description
x Value to compute exponential of.

Return value

frexp()

Description

Set exponent, double.

Prototype

double frexp(double   x,
             int    * exp);

Parameters

Parameter Description
x Floating value top operate on.
exp Pointer to integer receiving the power-of-two exponent of x.

Return value

Additional information

Breaks a floating-point number into a normalized fraction and an integral power of two.

frexpf()

Description

Set exponent, float.

Prototype

float frexpf(float   x,
             int   * exp);

Parameters

Parameter Description
x Floating value top operate on.
exp Pointer to integer receiving the power-of-two exponent of x.

Return value

Additional information

Breaks a floating-point number into a normalized fraction and an integral power of two.

hypot()

Description

Compute magnitude of complex, double.

Prototype

double hypot(double x,
             double y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

Additional information

Computes the square root of the sum of the squares of x and y without undue overflow or underflow. If x and y are the lengths of the sides of a right-angled triangle, then this computes the length of the hypotenuse.

hypotf()

Description

Compute magnitude of complex, float.

Prototype

float hypotf(float x,
             float y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

Additional information

Computes the square root of the sum of the squares of x and y without undue overflow or underflow. If x and y are the lengths of the sides of a right-angled triangle, then this computes the length of the hypotenuse.

log()

Description

Compute natural logarithm, double.

Prototype

double log(double x);

Parameters

Parameter Description
x Value to compute logarithm of.

Return value

logf()

Description

Compute natural logarithm, float.

Prototype

float logf(float x);

Parameters

Parameter Description
x Value to compute logarithm of.

Return value

log10()

Description

Compute common logarithm, double.

Prototype

double log10(double x);

Parameters

Parameter Description
x Value to compute logarithm of.

Return value

log10f()

Description

Compute common logarithm, float.

Prototype

float log10f(float x);

Parameters

Parameter Description
x Value to compute logarithm of.

Return value

ldexp()

Description

Scale by power of two, double.

Prototype

double ldexp(double x,
             int    n);

Parameters

Parameter Description
x Value to scale.
n Power of two to scale by.

Return value

Additional information

Multiplies a floating-point number by an integral power of two.

See also

scalbn()

ldexpf()

Description

Scale by power of two, float.

Prototype

float ldexpf(float x,
             int   n);

Parameters

Parameter Description
x Value to scale.
n Power of two to scale by.

Return value

Additional information

Multiplies a floating-point number by an integral power of two.

See also

scalbnf()

pow()

Description

Raise to power, double.

Prototype

double pow(double x,
           double y);

Parameters

Parameter Description
x Base.
y Power.

Return value

Return x raised to the power y.

powf()

Description

Raise to power, float.

Prototype

float powf(float x,
           float y);

Parameters

Parameter Description
x Base.
y Power.

Return value

Return x raised to the power y.

scalbn()

Description

Scale, double.

Prototype

double scalbn(double x,
              int    n);

Parameters

Parameter Description
x Value to scale.
n Power of DBL_RADIX to scale by.

Return value

Additional information

Multiplies a floating-point number by an integral power of DBL_RADIX.

As floating-point arithmetic conforms to IEC 60559, DBL_RADIX is 2 and scalbn() is (in this implementation) identical to ldexp().

See also

ldexpf()

scalbnf()

Description

Scale, float.

Prototype

float scalbnf(float x,
              int   n);

Parameters

Parameter Description
x Value to scale.
n Power of FLT_RADIX to scale by.

Return value

Additional information

Multiplies a floating-point number by an integral power of FLT_RADIX.

As floating-point arithmetic conforms to IEC 60559, FLT_RADIX is 2 and scalbnf() is (in this implementation) identical to ldexpf().

See also

ldexpf()

Trigonometric functions

Function Description
sin() Calculate sine, double.
sinf() Calculate sine, float.
cos() Calculate cosine, double.
cosf() Calculate cosine, float.
tan() Compute tangent, double.
tanf() Compute tangent, float.
sinh() Compute hyperbolic sine, double.
sinhf() Compute hyperbolic sine, float.
cosh() Compute hyperbolic cosine, double.
coshf() Compute hyperbolic cosine, float.
tanh() Compute hyperbolic tangent, double.
tanhf() Compute hyperbolic tangent, float.

sin()

Description

Calculate sine, double.

Prototype

double sin(double x);

Parameters

Parameter Description
x Angle to compute cosine of.

Return value

sinf()

Description

Calculate sine, float.

Prototype

float sinf(float x);

Parameters

Parameter Description
x Angle to compute sine of, radians.

Return value

cos()

Description

Calculate cosine, double.

Prototype

double cos(double x);

Parameters

Parameter Description
x Angle to compute cosine of, radians.

Return value

cosf()

Description

Calculate cosine, float.

Prototype

float cosf(float x);

Parameters

Parameter Description
x Angle to compute cosine of, radians.

Return value

tan()

Description

Compute tangent, double.

Prototype

double tan(double x);

Parameters

Parameter Description
x Angle to compute tangent of, radians.

Return value

tanf()

Description

Compute tangent, float.

Prototype

float tanf(float x);

Parameters

Parameter Description
x Angle to compute tangent of, radians.

Return value

sinh()

Description

Compute hyperbolic sine, double.

Prototype

double sinh(double x);

Parameters

Parameter Description
x Value to compute hyperbolic sine of.

Return value

sinhf()

Description

Compute hyperbolic sine, float.

Prototype

float sinhf(float x);

Parameters

Parameter Description
x Value to compute hyperbolic sine of.

Return value

cosh()

Description

Compute hyperbolic cosine, double.

Prototype

double cosh(double x);

Parameters

Parameter Description
x Value to compute hyperbolic cosine of.

Return value

coshf()

Description

Compute hyperbolic cosine, float.

Prototype

float coshf(float x);

Parameters

Parameter Description
x Value to compute hyperbolic cosine of.

Return value

tanh()

Description

Compute hyperbolic tangent, double.

Prototype

double tanh(double x);

Parameters

Parameter Description
x Value to compute hyperbolic tangent of.

Return value

tanhf()

Description

Compute hyperbolic tangent, float.

Prototype

float tanhf(float x);

Parameters

Parameter Description
x Value to compute hyperbolic tangent of.

Return value

Inverse trigonometric functions

Function Description
asin() Compute inverse sine, double.
asinf() Compute inverse sine, float.
acos() Compute inverse cosine, double.
acosf() Compute inverse cosine, float.
atan() Compute inverse tangent, double.
atanf() Compute inverse tangent, float.
atan2() Compute inverse tangent, with quadrant, double.
atan2f() Compute inverse tangent, with quadrant, float.
asinh() Compute inverse hyperbolic sine, double.
asinhf() Compute inverse hyperbolic sine, float.
acosh() Compute inverse hyperbolic cosine, double.
acoshf() Compute inverse hyperbolic cosine, float.
atanh() Compute inverse hyperbolic tangent, double.
atanhf() Compute inverse hyperbolic tangent, float.

asin()

Description

Compute inverse sine, double.

Prototype

double asin(double x);

Parameters

Parameter Description
x Value to compute inverse sine of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse circular sine of x. The principal value lies in the interval [-Pi/2, Pi/2] radians.

asinf()

Description

Compute inverse sine, float.

Prototype

float asinf(float x);

Parameters

Parameter Description
x Value to compute inverse sine of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse circular sine of x. The principal value lies in the interval [-Pi/2, Pi/2] radians.

acos()

Description

Compute inverse cosine, double.

Prototype

double acos(double x);

Parameters

Parameter Description
x Value to compute inverse cosine of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse circular sine of x. The principal value lies in the interval [0, Pi] radians.

acosf()

Description

Compute inverse cosine, float.

Prototype

float acosf(float x);

Parameters

Parameter Description
x Value to compute inverse cosine of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse circular sine of x. The principal value lies in the interval [0, Pi] radians.

atan()

Description

Compute inverse tangent, double.

Prototype

double atan(double x);

Parameters

Parameter Description
x Value to compute inverse tangent of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse tangent of x. The principal value lies in the interval [-Pi/2, Pi/2] radians.

atanf()

Description

Compute inverse tangent, float.

Prototype

float atanf(float x);

Parameters

Parameter Description
x Value to compute inverse tangent of.

Return value

Additional information

Calculates the principal value, in radians, of the inverse tangent of x. The principal value lies in the interval [-Pi/2, Pi/2] radians.

atan2()

Description

Compute inverse tangent, with quadrant, double.

Prototype

double atan2(double y,
             double x);

Parameters

Parameter Description
y Rise value of angle.
x Run value of angle.

Return value

Inverse tangent of y/x.

Additional information

This calculates the value, in radians, of the inverse tangent of y divided by x using the signs of x and y to compute the quadrant of the return value. The principal value lies in the interval [-Pi, +Pi] radians.

atan2f()

Description

Compute inverse tangent, with quadrant, float.

Prototype

float atan2f(float y,
             float x);

Parameters

Parameter Description
y Rise value of angle.
x Run value of angle.

Return value

Inverse tangent of y/x.

Additional information

This calculates the value, in radians, of the inverse tangent of y divided by x using the signs of x and y to compute the quadrant of the return value. The principal value lies in the interval [-Pi, +Pi] radians.

asinh()

Description

Compute inverse hyperbolic sine, double.

Prototype

double asinh(double x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic sine of.

Return value

Additional information

Calculates the inverse hyperbolic sine of x.

asinhf()

Description

Compute inverse hyperbolic sine, float.

Prototype

float asinhf(float x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic sine of.

Return value

Additional information

Calculates the inverse hyperbolic sine of x.

acosh()

Description

Compute inverse hyperbolic cosine, double.

Prototype

double acosh(double x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic cosine of.

Return value

Additional information

Calculates the non-negative inverse hyperbolic cosine of x.

acoshf()

Description

Compute inverse hyperbolic cosine, float.

Prototype

float acoshf(float x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic cosine of.

Return value

Additional information

Calculates the non-negative inverse hyperbolic cosine of x.

atanh()

Description

Compute inverse hyperbolic tangent, double.

Prototype

double atanh(double x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic tangent of.

Return value

Additional information

Calculates the non-negative inverse hyperbolic tangent of x.

atanhf()

Description

Compute inverse hyperbolic tangent, float.

Prototype

float atanhf(float x);

Parameters

Parameter Description
x Value to compute inverse hyperbolic tangent of.

Return value

Additional information

Calculates the non-negative inverse hyperbolic tangent of x.

Rounding and remainder functions

Function Description
ceil() Compute smallest integer not less than, double.
ceilf() Compute smallest integer not less than, float.
floor() Compute largest integer not greater than, double.
floorf() Compute largest integer not greater than, float.
fmod() Compute remainder after division, double.
fmodf() Compute remainder after division, float.
modf() Separate integer and fractional parts, double.
modff() Separate integer and fractional parts, float.

ceil()

Description

Compute smallest integer not less than, double.

Prototype

double ceil(double x);

Parameters

Parameter Description
x Value to compute ceiling of.

Return value

ceilf()

Description

Compute smallest integer not less than, float.

Prototype

float ceilf(float x);

Parameters

Parameter Description
x Value to compute ceiling of.

Return value

floor()

Description

Compute largest integer not greater than, double.

Prototype

double floor(double x);

Parameters

Parameter Description
x Value to floor.

Return value

floorf()

Description

Compute largest integer not greater than, float.

Prototype

float floorf(float x);

Parameters

Parameter Description
x Value to floor.

Return value

fmod()

Description

Compute remainder after division, double.

Prototype

double fmod(double x,
            double y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

Additional information

Computes the floating-point remainder of x divided by y, i.e. the value x - i*y for some integer i such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y.

fmodf()

Description

Compute remainder after division, float.

Prototype

float fmodf(float x,
            float y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

Additional information

Computes the floating-point remainder of x divided by y, i.e. the value x - i*y for some integer i such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y.

modf()

Description

Separate integer and fractional parts, double.

Prototype

double modf(double   x,
            double * iptr);

Parameters

Parameter Description
x Value to separate.
iptr Pointer to object that receives the integral part of x.

Return value

The signed fractional part of x.

Additional information

Breaks x into integral and fractional parts, each of which has the same type and sign as x.

The integral part (in floating-point format) is stored in the object pointed to by iptr and modf() returns the signed fractional part of x.

modff()

Description

Separate integer and fractional parts, float.

Prototype

float modff(float   x,
            float * iptr);

Parameters

Parameter Description
x Value to separate.
iptr Pointer to object that receives the integral part of x.

Return value

The signed fractional part of x.

Additional information

Breaks x into integral and fractional parts, each of which has the same type and sign as x.

The integral part (in floating-point format) is stored in the object pointed to by iptr and modff() returns the signed fractional part of x.

Absolute value functions

Function Description
fabs() Compute absolute value, double.
fabsf() Compute absolute value, float.

fabs()

Description

Compute absolute value, double.

Prototype

double fabs(double x);

Parameters

Parameter Description
x Value to compute magnitude of.

Return value

fabsf()

Description

Compute absolute value, float.

Prototype

float fabsf(float x);

Parameters

Parameter Description
x Value to compute magnitude of.

Return value

Fused multiply functions

Function Description
fma() Compute fused multiply-add, double.
fmaf() Compute fused multiply-add, float.

fma()

Description

Compute fused multiply-add, double.

Prototype

double fma(double x,
           double y,
           double z);

Parameters

Parameter Description
x Multiplicand.
y Multiplier.
z Summand.

Return value

Return (x * y) + z.

fmaf()

Description

Compute fused multiply-add, float.

Prototype

float fmaf(float x,
           float y,
           float z);

Parameters

Parameter Description
x Multiplier.
y Multiplicand.
z Summand.

Return value

Return (x * y) + z.

Maximum, minimum, and positive difference functions

Function Description
fmin() Compute minimum, double.
fminf() Compute minimum, float.
fmax() Compute maximum, double.
fmaxf() Compute maximum, float.

fmin()

Description

Compute minimum, double.

Prototype

double fmin(double x,
            double y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

fminf()

Description

Compute minimum, float.

Prototype

float fminf(float x,
            float y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

fmax()

Description

Compute maximum, double.

Prototype

double fmax(double x,
            double y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

fmaxf()

Description

Compute maximum, float.

Prototype

float fmaxf(float x,
            float y);

Parameters

Parameter Description
x Value #1.
y Value #2.

Return value

Arm AEABI library API

The SEGGER Floating-point Library provides an implementation of the Arm AEABI functions.

The assembly language floating-point funnctions are contained in separate files:

The interface to the AEABI functions differs from the standard calling convention when the hard-floating ABI is used: all floatting-point AEABI functions receive their parameters in integer registers and return their results in integer regsisters.

Floating arithmetic

Function Description
__aeabi_fadd Add, float.
__aeabi_dadd Add, double.
__aeabi_fsub Subtract, float.
__aeabi_dsub Subtract, double.
__aeabi_frsub Reverse subtract, float.
__aeabi_drsub Reverse subtract, double.
__aeabi_fmul Multiply, float.
__aeabi_dmul Multiply, double.
__aeabi_fdiv Divide, float.
__aeabi_ddiv Divide, double.

__aeabi_fadd()

Description

Add, float.

Prototype

__SEGGER_RTL_U32 __aeabi_fadd(__SEGGER_RTL_U32 x,
                              __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Augend.
y Addend.

Return value

Sum.

__aeabi_dadd()

Description

Add, double.

Prototype

__SEGGER_RTL_U64 __aeabi_dadd(__SEGGER_RTL_U64 x,
                              __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Augend.
y Addend.

Return value

Sum.

__aeabi_fsub()

Description

Subtract, float.

Prototype

__SEGGER_RTL_U32 __aeabi_fsub(__SEGGER_RTL_U32 x,
                              __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__aeabi_dsub()

Description

Subtract, double.

Prototype

__SEGGER_RTL_U64 __aeabi_dsub(__SEGGER_RTL_U64 x,
                              __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__aeabi_frsub()

Description

Reverse subtract, float.

Prototype

__SEGGER_RTL_U32 __aeabi_frsub(__SEGGER_RTL_U32 x,
                               __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__aeabi_drsub()

Description

Reverse subtract, double.

Prototype

__SEGGER_RTL_U64 __aeabi_drsub(__SEGGER_RTL_U64 x,
                               __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__aeabi_fmul()

Description

Multiply, float.

Prototype

__SEGGER_RTL_U32 __aeabi_fmul(__SEGGER_RTL_U32 x,
                              __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Multiplicand.
y Multiplier.

Return value

Product.

__aeabi_dmul()

Description

Multiply, double.

Prototype

__SEGGER_RTL_U64 __aeabi_dmul(__SEGGER_RTL_U64 x,
                              __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Multiplicand.
y Multiplier.

Return value

Product.

__aeabi_fdiv()

Description

Divide, float.

Prototype

__SEGGER_RTL_U32 __aeabi_fdiv(__SEGGER_RTL_U32 x,
                              __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Dividend.
y Divisor.

Return value

Quotient.

__aeabi_ddiv()

Description

Divide, double.

Prototype

__SEGGER_RTL_U64 __aeabi_ddiv(__SEGGER_RTL_U64 x,
                              __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Dividend.
y Divisor.

Return value

Quotient.

Floating conversions

Function Description
__aeabi_f2iz Convert __SEGGER_RTL_U32 to int.
__aeabi_d2iz Convert __SEGGER_RTL_U64 to int.
__aeabi_f2uiz Convert __SEGGER_RTL_U32 to __SEGGER_RTL_U32.
__aeabi_d2uiz Convert __SEGGER_RTL_U64 to unsigned.
__aeabi_f2lz Convert __SEGGER_RTL_U32 to long long.
__aeabi_d2lz Convert __SEGGER_RTL_U64 to long long.
__aeabi_f2ulz Convert __SEGGER_RTL_U32 to __SEGGER_RTL_U64.
__aeabi_d2ulz Convert __SEGGER_RTL_U64 to __SEGGER_RTL_U64.
__aeabi_i2f Convert int to float.
__aeabi_i2d Convert int to double.
__aeabi_ui2f Convert unsigned to float.
__aeabi_ui2d Convert unsigned to double.
__aeabi_l2f Convert long long to float.
__aeabi_l2d Convert long long to double.
__aeabi_ul2f Convert unsigned long long to float.
__aeabi_ul2d Convert unsigned long long to double.
__aeabi_f2d Extend float to double.
__aeabi_d2f Truncate double to float.
__aeabi_f2h Truncate float to IEEE half-precision float.
__aeabi_d2h Truncate double to IEEE half-precision float.
__aeabi_h2f Convert IEEE half-precision float to float.
__aeabi_h2d Convert IEEE half-precision float to double.

__aeabi_f2iz()

Description

Convert __SEGGER_RTL_U32 to int.

Prototype

__SEGGER_RTL_I32 __aeabi_f2iz(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__aeabi_d2iz()

Description

Convert __SEGGER_RTL_U64 to int.

Prototype

__SEGGER_RTL_I32 __aeabi_d2iz(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__aeabi_f2uiz()

Description

Convert __SEGGER_RTL_U32 to __SEGGER_RTL_U32.

Prototype

__SEGGER_RTL_U32 __aeabi_f2uiz(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__aeabi_d2uiz()

Description

Convert __SEGGER_RTL_U64 to unsigned.

Prototype

__SEGGER_RTL_U32 __aeabi_d2uiz(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Double value to convert.

Return value

Integerized value.

__aeabi_f2lz()

Description

Convert __SEGGER_RTL_U32 to long long.

Prototype

__SEGGER_RTL_I64 __aeabi_f2lz(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

Notes

The RV32 compiler converts a __SEGGER_RTL_U32 to a 64-bit integer by calling runtime support to handle it.

__aeabi_d2lz()

Description

Convert __SEGGER_RTL_U64 to long long.

Prototype

__SEGGER_RTL_I64 __aeabi_d2lz(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

Notes

RV32 always calls runtime for __SEGGER_RTL_U64 to int64 conversion.

__aeabi_f2ulz()

Description

Convert __SEGGER_RTL_U32 to __SEGGER_RTL_U64.

Prototype

__SEGGER_RTL_U64 __aeabi_f2ulz(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__aeabi_d2ulz()

Description

Convert __SEGGER_RTL_U64 to __SEGGER_RTL_U64.

Prototype

__SEGGER_RTL_U64 __aeabi_d2ulz(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__aeabi_i2f()

Description

Convert int to float.

Prototype

__SEGGER_RTL_U32 __aeabi_i2f(__SEGGER_RTL_I32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__aeabi_i2d()

Description

Convert int to double.

Prototype

__SEGGER_RTL_U64 __aeabi_i2d(__SEGGER_RTL_I32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__aeabi_ui2f()

Description

Convert unsigned to float.

Prototype

__SEGGER_RTL_U32 __aeabi_ui2f(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__aeabi_ui2d()

Description

Convert unsigned to double.

Prototype

__SEGGER_RTL_U64 __aeabi_ui2d(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Unsigned value to convert.

Return value

__SEGGER_RTL_U64 value.

__aeabi_l2f()

Description

Convert long long to float.

Prototype

__SEGGER_RTL_U32 __aeabi_l2f(__SEGGER_RTL_I64 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__aeabi_l2d()

Description

Convert long long to double.

Prototype

__SEGGER_RTL_U64 __aeabi_l2d(__SEGGER_RTL_I64 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__aeabi_ul2f()

Description

Convert unsigned long long to float.

Prototype

__SEGGER_RTL_U32 __aeabi_ul2f(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Unsigned long long value to convert.

Return value

__SEGGER_RTL_U32 value.

__aeabi_ul2d()

Description

Convert unsigned long long to double.

Prototype

__SEGGER_RTL_U64 __aeabi_ul2d(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Unsigned long long value to convert.

Return value

__SEGGER_RTL_U64 value.

__aeabi_f2d()

Description

Extend float to double.

Prototype

__SEGGER_RTL_U64 __aeabi_f2d(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Floating value to extend.

Return value

__SEGGER_RTL_U64 value.

__aeabi_d2f()

Description

Truncate double to float.

Prototype

__SEGGER_RTL_U32 __aeabi_d2f(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Double value to truncate.

Return value

Float value.

__aeabi_f2h()

Description

Truncate float to IEEE half-precision float.

Prototype

__SEGGER_RTL_U16 __aeabi_f2h(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Float value to truncate.

Return value

Float value.

__aeabi_d2h()

Description

Truncate double to IEEE half-precision float.

Prototype

__SEGGER_RTL_U16 __aeabi_d2h(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Double value to truncate.

Return value

Half-precision value.

__aeabi_h2f()

Description

Convert IEEE half-precision float to float.

Prototype

__SEGGER_RTL_U32 __aeabi_h2f(__SEGGER_RTL_U16 x);

Parameters

Parameter Description
x Half-precision float.

Return value

Single-precision float.

__aeabi_f2h()

Description

Truncate float to IEEE half-precision float.

Prototype

__SEGGER_RTL_U16 __aeabi_f2h(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Float value to truncate.

Return value

Float value.

Floating comparisons

Function Description
__aeabi_fcmpeq Equal, float.
__aeabi_dcmpeq Equal, double.
__aeabi_fcmplt Less than, float.
__aeabi_dcmplt Less than, double.
__aeabi_fcmple Less than or equal, float.
__aeabi_dcmple Less than, double.
__aeabi_fcmpgt Less than, float.
__aeabi_dcmpgt Less than, double.
__aeabi_fcmpge Less than, float.
__aeabi_dcmpge Less than, double.

__aeabi_fcmpeq()

Description

Equal, float.

Prototype

int __aeabi_fcmpeq(__SEGGER_RTL_U32 x,
                   __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not equal to y.
1 x is equal to y.

__aeabi_dcmpeq()

Description

Equal, double.

Prototype

int __aeabi_dcmpeq(__SEGGER_RTL_U64 x,
                   __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not equal to y.
1 x is equal to y.

__aeabi_fcmplt()

Description

Less than, float.

Prototype

int __aeabi_fcmplt(__SEGGER_RTL_U32 x,
                   __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not less than y.
1 x is less than y.

__aeabi_dcmplt()

Description

Less than, double.

Prototype

int __aeabi_dcmplt(__SEGGER_RTL_U64 x,
                   __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not less than y.
1 x is less than y.

__aeabi_fcmple()

Description

Less than or equal, float.

Prototype

int __aeabi_fcmple(__SEGGER_RTL_U32 x,
                   __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not less than or equal to y.
1 x is less than or equal to y.

__aeabi_dcmple()

Description

Less than, double.

Prototype

int __aeabi_dcmple(__SEGGER_RTL_U64 x,
                   __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not less than or equal to y.
1 x is less than or equal to y.

__aeabi_fcmpgt()

Description

Less than, float.

Prototype

int __aeabi_fcmpgt(__SEGGER_RTL_U32 x,
                   __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not greater than y.
1 x is greater than y.

__aeabi_dcmpgt()

Description

Less than, double.

Prototype

int __aeabi_dcmpgt(__SEGGER_RTL_U64 x,
                   __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not greater than y.
1 x is greater than y.

__aeabi_fcmpge()

Description

Less than, float.

Prototype

int __aeabi_fcmpge(__SEGGER_RTL_U32 x,
                   __SEGGER_RTL_U32 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not greater than or equal to y.
1 x is greater than or equal to y.

__aeabi_dcmpge()

Description

Less than, double.

Prototype

int __aeabi_dcmpge(__SEGGER_RTL_U64 x,
                   __SEGGER_RTL_U64 y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

0 x is not greater than or equal to y.
1 x is greater than or equal to y.

GNU libgcc library API

The GNU floating-point runtime ABI can be realized in C and optionally in assembly language.

The assembly language floating-point funnctions are contained in separate files:

Floating arithmetic

Function Description
__addsf3 Add, float.
__adddf3 Add, double.
__subsf3 Subtract, float.
__subdf3 Subtract, double.
__mulsf3 Multiply, float.
__muldf3 Multiply, double.
__divsf3 Divide, float.
__divdf3 Divide, double.

__addsf3()

Description

Add, float.

Prototype

float __addsf3(float x,
               float y);

Parameters

Parameter Description
x Augend.
y Addend.

Return value

Sum.

__adddf3()

Description

Add, double.

Prototype

double __adddf3(double x,
                double y);

Parameters

Parameter Description
x Augend.
y Addend.

Return value

Sum.

__subsf3()

Description

Subtract, float.

Prototype

float __subsf3(float x,
               float y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__subdf3()

Description

Subtract, double.

Prototype

double __subdf3(double x,
                double y);

Parameters

Parameter Description
x Minuend.
y Subtrahend.

Return value

Difference.

__mulsf3()

Description

Multiply, float.

Prototype

float __mulsf3(float x,
               float y);

Parameters

Parameter Description
x Multiplicand.
y Multiplier.

Return value

Product.

__muldf3()

Description

Multiply, double.

Prototype

double __muldf3(double x,
                double y);

Parameters

Parameter Description
x Multiplicand.
y Multiplier.

Return value

Product.

__divsf3()

Description

Divide, float.

Prototype

float __divsf3(float x,
               float y);

Parameters

Parameter Description
x Dividend.
y Divisor.

Return value

Quotient.

__divdf3()

Description

Divide, double.

Prototype

double __divdf3(double x,
                double y);

Parameters

Parameter Description
x Dividend.
y Divisor.

Return value

Quotient.

Floating conversions

Function Description
__fixsfsi Convert float to int.
__fixdfsi Convert double to int.
__fixsfdi Convert float to long long.
__fixdfdi Convert double to long long.
__fixunssfsi Convert float to unsigned.
__fixunsdfsi Convert double to unsigned.
__fixunssfdi Convert float to unsigned long long.
__fixunsdfdi Convert double to unsigned long long.
__floatsisf Convert int to float.
__floatsidf Convert int to double.
__floatdisf Convert long long to float.
__floatdidf Convert long long to double.
__floatunsisf Convert unsigned to float.
__floatunsidf Convert unsigned to double.
__floatundisf Convert unsigned long long to float.
__floatundidf Convert unsigned long long to double.
__extendsfdf2 Extend float to double.
__truncdfsf2 Truncate double to float.

__fixsfsi()

Description

Convert float to int.

Prototype

__SEGGER_RTL_I32 __fixsfsi(float x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__fixdfsi()

Description

Convert double to int.

Prototype

__SEGGER_RTL_I32 __fixdfsi(double x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

__fixsfdi()

Description

Convert float to long long.

Prototype

__SEGGER_RTL_I64 __fixsfdi(float f);

Parameters

Parameter Description
f Floating value to convert.

Return value

Integerized value.

Notes

The RV32 compiler converts a float to a 64-bit integer by calling runtime support to handle it.

__fixdfdi()

Description

Convert double to long long.

Prototype

__SEGGER_RTL_I64 __fixdfdi(double x);

Parameters

Parameter Description
x Floating value to convert.

Return value

Integerized value.

Notes

RV32 always calls runtime for double to int64 conversion.

__fixunssfsi()

Description

Convert float to unsigned.

Prototype

__SEGGER_RTL_U32 __fixunssfsi(float x);

Parameters

Parameter Description
x Float value to convert.

Return value

Integerized value.

__fixunsdfsi()

Description

Convert double to unsigned.

Prototype

__SEGGER_RTL_U32 __fixunsdfsi(double x);

Parameters

Parameter Description
x Float value to convert.

Return value

Integerized value.

__fixunssfdi()

Description

Convert float to unsigned long long.

Prototype

__SEGGER_RTL_U64 __fixunssfdi(float f);

Parameters

Parameter Description
f Float value to convert.

Return value

Integerized value.

__fixunsdfdi()

Description

Convert double to unsigned long long.

Prototype

__SEGGER_RTL_U64 __fixunsdfdi(double x);

Parameters

Parameter Description
x Float value to convert.

Return value

Integerized value.

__floatsisf()

Description

Convert int to float.

Prototype

float __floatsisf(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__floatsidf()

Description

Convert int to double.

Prototype

double __floatsidf(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__floatdisf()

Description

Convert long long to float.

Prototype

float __floatdisf(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__floatdidf()

Description

Convert long long to double.

Prototype

double __floatdidf(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__floatunsisf()

Description

Convert unsigned to float.

Prototype

float __floatunsisf(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Integer value to convert.

Return value

Floating value.

__floatunsidf()

Description

Convert unsigned to double.

Prototype

double __floatunsidf(__SEGGER_RTL_U32 x);

Parameters

Parameter Description
x Unsigned value to convert.

Return value

Double value.

__floatundisf()

Description

Convert unsigned long long to float.

Prototype

float __floatundisf(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Unsigned long long value to convert.

Return value

Float value.

__floatundidf()

Description

Convert unsigned long long to double.

Prototype

double __floatundidf(__SEGGER_RTL_U64 x);

Parameters

Parameter Description
x Unsigned long long value to convert.

Return value

Double value.

__extendsfdf2()

Description

Extend float to double.

Prototype

double __extendsfdf2(float x);

Parameters

Parameter Description
x Float value to extend.

Return value

Double value.

__truncdfsf2()

Description

Truncate double to float.

Prototype

float __truncdfsf2(double x);

Parameters

Parameter Description
x Double value to truncate.

Return value

Float value.

Floating comparisons

Function Description
__eqsf2 Equal, float.
__eqdf2 Equal, double.
__nesf2 Not equal, float.
__nedf2 Not equal, double.
__ltsf2 Less than, float.
__ltdf2 Less than, double.
__lesf2 Less than or equal, float.
__ledf2 Less than or equal, double.
__gtsf2 Greater than, float.
__gtdf2 Greater than, double.
__gesf2 Greater than or equal, float.
__gedf2 Greater than or equal, double.

__eqsf2()

Description

Equal, float.

Prototype

int __eqsf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return = 0 if both operands are non-NaN and a = b (GNU three-way boolean).

__eqdf2()

Description

Equal, double.

Prototype

int __eqdf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return = 0 if both operands are non-NaN and a = b (GNU three-way boolean).

__nesf2()

Description

Not equal, float.

Prototype

int __nesf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return = 0 if both operands are non-NaN and a = b (GNU three-way boolean).

__nedf2()

Description

Not equal, double.

Prototype

int __nedf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return = 0 if both operands are non-NaN and a = b (GNU three-way boolean).

__ltsf2()

Description

Less than, float.

Prototype

int __ltsf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return < 0 if both operands are non-NaN and a < b (GNU three-way boolean).

__ltdf2()

Description

Less than, double.

Prototype

int __ltdf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return < 0 if both operands are non-NaN and a < b (GNU three-way boolean).

__lesf2()

Description

Less than or equal, float.

Prototype

int __lesf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return ≤ 0 if both operands are non-NaN and a < b (GNU three-way boolean).

__ledf2()

Description

Less than or equal, double.

Prototype

int __ledf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return ≤ 0 if both operands are non-NaN and a < b (GNU three-way boolean).

__gtsf2()

Description

Greater than, float.

Prototype

int __gtsf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return > 0 if both operands are non-NaN and a > b (GNU three-way boolean).

__gtdf2()

Description

Greater than, double.

Prototype

int __gtdf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return > 0 if both operands are non-NaN and a > b (GNU three-way boolean).

__gesf2()

Description

Greater than or equal, float.

Prototype

int __gesf2(float x,
            float y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return ≥ 0 if both operands are non-NaN and a ≥ b (GNU three-way boolean).

__gedf2()

Description

Greater than or equal, double.

Prototype

int __gedf2(double x,
            double y);

Parameters

Parameter Description
x Left-hand operand.
y Right-hand operand.

Return value

Return ≥ 0 if both operands are non-NaN and a ≥ b (GNU three-way boolean).