How to use scalblnl function to multiplies a long double by (FLT_RADIX raised to power exp) in C

1 Answer

0 votes
#include<stdio.h>
#include <math.h>

#include <float.h> // FLT_RADIX

int main(void) {
    printf("%d\n", FLT_RADIX); // 2

    printf("%Lf\n", scalblnl(4.0, 4)); // 4.0 * (2 ^ 4)
    printf("%Lf\n", scalblnl(3.6, -8)); // 3.6 * (2 ^ -8)
    printf("%Lf\n", scalblnl(5.8, 0)); // If exp is 0 then arg is returned

	return 0;
}




/*
run:

2
64.000000
0.014063
5.800000

*/

 



answered Aug 2, 2022 by avibootz
...