Developer Guide

Intel oneAPI FPGA Handbook

ID 785441
Date 2/07/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Additional ap_float Functions

The ap_float data type also provides the following additional functions:

Additional ap_float Functions
Function Description
Getters and Setters

ap_float::get_exponent

ap_float::set_exponent

Gets/sets the exponent value of the ap_float variable.

ap_float::get_mantissa

ap_float::set_mantissa

Gets/sets the mantissa value of the ap_float variable.

ap_float::get_sign

ap_float::set_sign

Gets/sets the sign bit of the ap_float variable.
Special Constants
ap_float<e,m>::nan() Assigns the ap_float variable a value of NaN.
ap_float<e,m>::pos_inf() Assigns the ap_float variable a value of +∞.
ap_float<e,m>::neg_inf() Assigns the ap_float variable a value of −∞.
Value Queries
ap_float::is_nan() Returns true if the value of the ap_float variable is NaN.
ap_float::is_inf() Returns true if the value of the ap_float variable is ±∞.
ap_float::is_zero() Returns true if the value of the ap_float variable is zero.
Special Functions
ap_float::next_after(next_val) Returns the next representable value towards next_val.