diff --git a/ARM/mikroC/std_library/include/math.h b/ARM/mikroC/std_library/include/math.h index 4e4727528..14886c5f3 100644 --- a/ARM/mikroC/std_library/include/math.h +++ b/ARM/mikroC/std_library/include/math.h @@ -67,6 +67,17 @@ double floor( double num ); */ double ceil( double num ); +/** + * @brief Rounds a number to the nearest integer. + * @details The round function rounds the given number to the nearest integer value. + * If the fractional part of the number is exactly 0.5, the round function + * adjusts the number upwards to the next integer with greater magnitude. + * @param num Number to be rounded. + * @return The round function returns the nearest integer value to the given + * number, expressed as a double. + */ +double round( double num ); + /** * @brief Function splits a floating-point number. * The frexp function breaks a floating-point number into a normalized diff --git a/AVR/mikroC/std_library/include/math.h b/AVR/mikroC/std_library/include/math.h index 8ac70baaf..52910e338 100644 --- a/AVR/mikroC/std_library/include/math.h +++ b/AVR/mikroC/std_library/include/math.h @@ -69,6 +69,17 @@ double floor( double num ); */ double ceil( double num ); +/** + * @brief Rounds a number to the nearest integer. + * @details The round function rounds the given number to the nearest integer value. + * If the fractional part of the number is exactly 0.5, the round function + * adjusts the number upwards to the next integer with greater magnitude. + * @param num Number to be rounded. + * @return The round function returns the nearest integer value to the given + * number, expressed as a double. + */ +double round( double num ); + /** * @brief Function splits a floating-point number. * @details The frexp function breaks a floating-point number into a normalized diff --git a/PIC/mikroC/std_library/include/math.h b/PIC/mikroC/std_library/include/math.h index 7975930e2..c982e67c3 100644 --- a/PIC/mikroC/std_library/include/math.h +++ b/PIC/mikroC/std_library/include/math.h @@ -69,6 +69,17 @@ double floor( double num ); */ double ceil( double num ); +/** + * @brief Rounds a number to the nearest integer. + * @details The round function rounds the given number to the nearest integer value. + * If the fractional part of the number is exactly 0.5, the round function + * adjusts the number upwards to the next integer with greater magnitude. + * @param num Number to be rounded. + * @return The round function returns the nearest integer value to the given + * number, expressed as a double. + */ +double round( double num ); + /** * @brief Function splits a floating-point number. * @details The frexp function breaks a floating-point number into a normalized diff --git a/PIC32/mikroC/std_library/include/math.h b/PIC32/mikroC/std_library/include/math.h index 9654818d8..4f35f3513 100644 --- a/PIC32/mikroC/std_library/include/math.h +++ b/PIC32/mikroC/std_library/include/math.h @@ -68,6 +68,17 @@ double floor( double num ); */ double ceil( double num ); +/** + * @brief Rounds a number to the nearest integer. + * @details The round function rounds the given number to the nearest integer value. + * If the fractional part of the number is exactly 0.5, the round function + * adjusts the number upwards to the next integer with greater magnitude. + * @param num Number to be rounded. + * @return The round function returns the nearest integer value to the given + * number, expressed as a double. + */ +double round( double num ); + /** * @brief Function splits a floating-point number. * @details frexp function breaks a floating-point number into a normalized diff --git a/dsPIC/mikroC/std_library/include/math.h b/dsPIC/mikroC/std_library/include/math.h index faf463ef1..8fe86ab0d 100644 --- a/dsPIC/mikroC/std_library/include/math.h +++ b/dsPIC/mikroC/std_library/include/math.h @@ -69,6 +69,17 @@ double floor( double num ); */ double ceil( double num ); +/** + * @brief Rounds a number to the nearest integer. + * @details The round function rounds the given number to the nearest integer value. + * If the fractional part of the number is exactly 0.5, the round function + * adjusts the number upwards to the next integer with greater magnitude. + * @param num Number to be rounded. + * @return The round function returns the nearest integer value to the given + * number, expressed as a double. + */ +double round( double num ); + /** * @brief Function splits a floating-point number. * @details The function breaks a floating-point number into a normalized