ilogb() in C++

ilogb(): 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.

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

Syntax:

ilogb(X)

For Example:

ilogb(10.45) = > It returns 3.

Approach:

C++

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

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

    return 0;
}


No comments:

Post a Comment