0

How to calculate the range of float and double in c

8th Mar 2018, 8:40 PM
Deepak Kushwaha
Deepak Kushwaha - avatar
2 Answers
- 1
You can use the 'sizeof' macro to get the size in bytes. ex: printf("%i bytes\n", sizeof(double)); I'm not quite sure how you'd get the range considering weather they are signed/unsigned and being floating point types so I did some searching and came across a detailed explanation which should help. https://stackoverflow.com/questions/10108053/ranges-of-floating-point-datatype-in-c
8th Mar 2018, 9:58 PM
Lewis
Lewis - avatar