llrint() in C++

The llrint() function rounds the fractional value given in the argument to an integral value using the current rounding mode. This function is defined in <cmath> library. The current mode is determined by the function fesetround().

Note: This function returns the value in a long long int.

Syntax

llrint(double a);
llrint(float a);

Parameter

  • The llrint() function takes double or float or integer value as an argument.

Return

  • The llrint() function rounds the fractional value given in the argument to an integral value using the current rounding mode and returns the value in long long int.
    Here, the current mode is determined by the function fesetround(). By default, the rounding direction is set to ‘to-nearest’. It can be changed using fesetround().

Error

  • It is mandatory to give an argument otherwise it will give error no matching function for call to ‘llrint()’ like this.

lrint() and llrint() in C++

Similar Reads

lrint() in C++

The lrint() function rounds the fractional value given in the argument to an integral value using the current rounding mode. This function is defined in library. The current mode is determined by the function fesetround()....

Examples of lrint()

Example 1...

llrint() in C++

...

Examples of llrint()

...

Contact Us