Responsible for floating-point precision processing.
More...
#include <sttnet_English.h>
|
| static std::string & | getPreciesFloat (const float &number, const int &bit, std::string &str) |
| | Format a floating-point number into a string representation with a specified number of decimal places. More...
|
| |
| static float & | getPreciesFloat (float &number, const int &bit) |
| | Retain a specified number of decimal places for a float value and modify the original value directly. More...
|
| |
| static std::string & | getPreciesDouble (const double &number, const int &bit, std::string &str) |
| | Format a double-precision floating-point number into a string representation with a specified number of decimal places. More...
|
| |
| static double & | getPreciesDouble (double &number, const int &bit) |
| | Retain a specified number of decimal places for a double value and modify the original value directly. More...
|
| |
| static float & | getValidFloat (float &number, const int &bit) |
| | Dynamically adjust the decimal precision based on the value, retaining a specified number of significant figures. More...
|
| |
Responsible for floating-point precision processing.
| static std::string& stt::data::PrecisionUtil::getPreciesDouble |
( |
const double & |
number, |
|
|
const int & |
bit, |
|
|
std::string & |
str |
|
) |
| |
|
static |
Format a double-precision floating-point number into a string representation with a specified number of decimal places.
- Parameters
-
| number | Input double value. |
| bit | Number of decimal places to retain. |
| str | Used to store the formatted string. |
- Returns
- Reference to the formatted result string.
| static double& stt::data::PrecisionUtil::getPreciesDouble |
( |
double & |
number, |
|
|
const int & |
bit |
|
) |
| |
|
static |
Retain a specified number of decimal places for a double value and modify the original value directly.
- Parameters
-
| number | Double variable to be processed (will be modified). |
| bit | Number of decimal places to retain. |
- Returns
- Reference to the modified double.
| static std::string& stt::data::PrecisionUtil::getPreciesFloat |
( |
const float & |
number, |
|
|
const int & |
bit, |
|
|
std::string & |
str |
|
) |
| |
|
static |
Format a floating-point number into a string representation with a specified number of decimal places.
- Parameters
-
| number | Input floating-point number. |
| bit | Number of decimal places to retain. |
| str | Used to store the formatted string. |
- Returns
- Reference to the formatted result string.
| static float& stt::data::PrecisionUtil::getPreciesFloat |
( |
float & |
number, |
|
|
const int & |
bit |
|
) |
| |
|
static |
Retain a specified number of decimal places for a float value and modify the original value directly.
- Parameters
-
| number | Float variable to be processed (will be modified). |
| bit | Number of decimal places to retain. |
- Returns
- Reference to the modified float.
| static float& stt::data::PrecisionUtil::getValidFloat |
( |
float & |
number, |
|
|
const int & |
bit |
|
) |
| |
|
static |
Dynamically adjust the decimal precision based on the value, retaining a specified number of significant figures.
For decimals less than 1, the position of the most significant digit is first determined, and then bit significant figures are retained on this basis. The modified value will be rounded to retain the appropriate number of decimal places and written back to the original variable.
- Parameters
-
| number | Float value to be processed (will be modified). |
| bit | Number of significant figures to retain. |
- Returns
- Reference to the modified float.
The documentation for this class was generated from the following file: