How to get the absolute value of a long double in C

1 Answer

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

int main()
{
    long double d = -2909374.983571;
    
    printf("%lf\n", fabsl(d));
    
    return 0;
}



/*
run:

2909374.983571

*/

 



answered Jan 23, 2023 by avibootz

Related questions

1 answer 92 views
1 answer 114 views
1 answer 127 views
1 answer 136 views
1 answer 129 views
1 answer 167 views
...