How to get the absolute value of a double in C

1 Answer

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

int main()
{
    double d = -7348.1392;
    
    printf("%f\n", fabs(d));
    
    return 0;
}



/*
run:

7348.139200

*/

 



answered Jan 23, 2023 by avibootz

Related questions

1 answer 119 views
1 answer 136 views
136 views asked Jan 23, 2023 by avibootz
1 answer 191 views
1 answer 214 views
1 answer 161 views
161 views asked Jun 29, 2015 by avibootz
...