ilogbf() in C++

ilogbf(): This function is available in the file math.h. It takes one parameter. This function returns an integral part of the logarithm of |x|, using FLT_RADIX as a base for the logarithm. 

Parameters: One parameter is required for this function. The floating-point value is taken as an argument.

X: The value whose logarithm value is to be determined.

Syntax:

ilogbf(X)

For Example:

ilogbf(10.45) = > It returns 3.

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    float x = 10.5;
    cout << ilogbf(x<< "\n";

    return 0;
}


No comments:

Post a Comment