Home >>C++ Tutorial >C++ Numbers

Generally, while working with the **numbers in C++**, the use of primitive data types like long, short, float, int, etc. are used. These are basically the general math functions that are provided by the C++ programming and

**Here are the list of functions sorted according to their genre along with a brief description:**

Method | Description |
---|---|

ceil(x) | This function rounds up the value of x. |

floor(x) | This function generally rounds down the value of x. |

round(x) | This function generally rounds off the value of x. |

lround(x) | This function is used to round off the value of x and cast to long integer. |

llround(x) | This function is used to round off the value of x and cast that value to the long integer. |

fmod(n,d) | This function is used to calculate the remainder of division n/d. |

trunc(x) | This function is used to round off the value x towards zero. |

rint(x) | This function is used to round off the value of x using rounding mode. |

lrint(x) | This function is used to round off the value of x using rounding mode and cast to long integer. |

llrint(x) | This function is used to round off the value x and cast to long long integer. |

nearbyint(x) | This function is used to round off the value x to a nearby integral value. |

remainder(n,d) | This function is used to calculate the remainder of n/d. |

remquo() | This function is used to calculate the remainder and quotient both. |

Method | Description |
---|---|

pow(x,y) | This function generally computes x raised to the power y. |

sqrt(x) | This function generally calculates the square root of x. |

cbrt(x) | This function generally calculates the cube root of x. |

hypot(x,y) | This function is used to find the hypotenuse of a right angled triangle. |

Method | Description |
---|---|

cos(x) | This function in C++ is used to compute the cosine of x. |

sin(x) | This function in C++ is used to compute the sine of x. |

tan(x) | This function in C++ is used to compute the tangent of x. |

acos(x) | This function in C++ is used to find the inverse cosine of x. |

asin(x) | This function in C++ is used to find the inverse sine of x. |

atan(x) | This function in C++ is used to find the inverse tangent of x. |

atan2(x,y | This function in C++ is used to find the inverse tangent of a coordinate x and y. |

Method | Description |
---|---|

cosh(x) | This function in C++ is used to compute the hyperbolic cosine of x. |

sinh(x) | This function in C++ is used to compute the hyperbolic sine of x. |

tanh(x) | This function in C++ is used to compute the hyperbolic tangent of x. |

acosh(x) | This function in C++ is used to find the arc hyperbolic cosine of x. |

asinh(x) | This function in C++ is used to find the arc hyperbolic sine of x. |

atanh(x) | This function in C++ is used to find the arc hyperbolic tangent of x. |

Method | Description |
---|---|

exp(x) | This function in C++ is used to compute the exponential e raised to the power x. |

frexp(value_type x,int* exp) | This function in C++ is used to break a number into significand and 2 raised to the power exponent. |

Idexp(float x, int e) | This function in C++ is used to compute the product of x and 2 raised to the power e. |

log(x) | This function in C++ is used to compute the natural logarithm of x. |

log10(x) | This function in C++ is used to compute the common logarithm of x. |

modf() | This function in C++ is used to break a number into an integer and fractional part. |

exp2(x) | This function in C++ is used to compute the base 2 exponential of x. |

expm1(x) | This function in C++ is used to compute the exponential raised to the power x minus one. |

log1p(x) | This function in C++ is used to compute the natural logarithm of x plus one. |

log2(x) | This function in C++ is used to compute the base 2 logarithm of x. |

logb(x) | This function in C++ is used to compute the logarithm of x. |

scalbn( x, n) | This function in C++ is used to compute the product of x and FLT_RADX raised to the power n. |

scalbln( x, n) | This function in C++ is used to compute the product of x and FLT_RADX raised to the power n. |

ilogb(x) | This function in C++ is used to return the exponent part of x. |

Method | Description |
---|---|

copysign(x,y) | This function in C++ is used to return the magnitude of x with the sign of y. |

nextafter(x,y) | This function is generally used to represent the next representable value of x in the direction of y. |

nexttoward(x,y) | This function is generally used to represent the next representable value of x in the direction of y. |

Method | Description |
---|---|

fdim(x,y) | This function is used to calculate the positive difference between x and y. |

fmax(x,y) | This function returns the larger number among two numbers x and y. |

fmin() | This function returns the smaller number among two numbers x and y . |

C++ Tutorial
C Vs CPP
C++ history
C++ features
C++ Installation
c++ Syntax
C++ Comments
C++ Variable
C++ Basic Input/Output
C++ Data Types
C++ Operators
C++ Keywords
C++ if-else
C++ Switch
C++ For Loop
C++ While Loop
C++ Do While Loop
C++ Functions
C++ Call By Value & Call By Reference
C++ Arrays
C++ Multi-Dimensional Arrays
C++ Strings
C++ Numbers
C++ Pointers
C++ Date and Time
C++ Data Structures
C++ OOPs Concepts
C++ Classes and Objects
C++ Constructor
C++ Copy Constructor
C++ Destructor
C++ This Pointer
C++ Static
C++ structs
C++ Friend Function
C++ Inheritance
C++ Polymorphism
C++ method Overloading
C++ method Overriding
C++ Class Access Modifiers
C++ Virtual Function
C++ Interface
C++ Data Abstraction
C++ Namespaces
C++ Exception Handling
C++ try catch
C++ File Streams