Skip to content

Commit

Permalink
Added round function to all mikroC headers
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRuzavin committed Jul 30, 2024
1 parent 6b7fbfa commit 8b33626
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ARM/mikroC/std_library/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions AVR/mikroC/std_library/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions PIC/mikroC/std_library/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions PIC32/mikroC/std_library/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions dsPIC/mikroC/std_library/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b33626

Please sign in to comment.