frexp() in C++ Last Updated : 14 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The frexp() function breaks the floating point number x into its binary significand i., e., floating point with an absolute value between [0.5, 1.0) and an integral exponent for 2. x = significand * (2^exponent). It used to : 1. It is used to find significand which is always between 0.5 and 1.0 2. It is used to find exponent which is power of 2. Syntax: double frexp (double x); float frexp (float x); long double frexp (long double x);The frexp() function takes a single argument.The frexp() function returns the binary significand whose absolute value lies in the interval [0.5, 1).If x is zero, both significand and exponent are zero. Error and Exception: It is mandatory to give both the arguments otherwise it will give error no matching function for call to 'frexp()'.If we pass a string as an argument we will get an error no matching function for call to 'frexp(const char [n]). If x=0 then significand is zero and exponent is zerox >= 1 then significand is positive number and exponent is positive numberx <= -1 then significand is negative number and exponent is positive number-1 < x < 0 then significand is negative number and exponent is negative number0 < x < 1 then significand is positive number and exponent is negative number # CODE 1 CPP // CPP implementation of // above function #include <cmath> #include <iostream> using namespace std; // Driver program int main() { double x = 5.35, significand; int exponent; significand = frexp(x, &exponent); cout << x << " = " << significand << " * 2^" << exponent << endl; return 0; } Output:5.35 = 0.66875 * 2^3 # CODE 2 CPP // CPP implementation of the // above function #include <cmath> #include <iostream> using namespace std; // Driver program int main() { double significand; int exponent, x = 5; significand = frexp(x, &exponent); cout << x << " = " << significand << " * 2^" << exponent << endl; return 0; } Output:5 = 0.625 * 2^3 Comment More infoAdvertise with us Next Article feholdexcept() in C/C++ P pawan_asipu Follow Improve Article Tags : Misc C++ cpp-math Practice Tags : CPPMisc Similar Reads expm1() in C++ The expm1(x) function returns ex - 1 where x is an argument and e is mathematical constant with value equal to 2.71828. Syntax: double expm1() (double x); float expm1() (float x); long double expm1() (long double x);The expm1() function takes a single argument and computes e^x -1.The expm1() functio 2 min read exp() function C++ The exp() function in C++ returns the exponential (Euler's number) e (or 2.71828) raised to the given argument. Syntax for returning exponential e: result=exp() Parameter: The function can take any value i.e, positive, negative or zero in its parameter and returns result in int, double or float or l 2 min read feholdexcept() in C/C++ The feholdexcept() function in C/C++ first saves the current floating-point environment in the object of fenv_t and it then resets the current values of all the floating point status flags. The feholdexcept() function is defined in cfenv header file in C++ and in fenv.h header file in C. Syntax: int 2 min read C++ Dereferencing Prerequisites: Pointers in C++References in C++ Pointers are symbolic representations of addresses. They enable programs to simulate call-by-reference as well as to create and manipulate dynamic data structures. Iterating over elements in arrays or other data structures is one of the main use of poi 5 min read find() in C++ STL C++ find() is a built-in function used to find the first occurrence of an element in the given range. It works with any container that supports iterators, such as arrays, vectors, lists, and more. In this article, we will learn about find() function in C++.C++#include <bits/stdc++.h> using nam 2 min read ldexp() in C++ The ldexp() function takes two arguments a and b and returns the product of a and 2 raised to the power of b i.e., a * (2b). Syntax: double ldexp (double a, double b); float ldexp (float a, float b); long double ldexp (long double a, long double b); Errors and exceptions associated with this functio 2 min read Like