@Mohit Jain is suitable for practical coding.
By specification C, DBL_DIG or FLT_RADIX/DBL_MANT_DIG and INT_MAX/INT_MIN are important values.
DBL_DIG in maximum decimal digits, the number of which may have, which, when converted to double and vice versa, will certainly have the same value. It is not less than 10. Thus, an integer, for example 9999999999, of course, can be converted to double and vice versa without loss of precision. Possible larger values can also be successfully rounded.
The real circular motion problem starts with integer values greater than +/-power(FLT_RADIX, DBL_MANT_DIG) . FLT_RADIX is the floating point base (and the vast majority 2 ), and DBL_MANT_DIG is the number of “base- FLT_RADIX digits in the floating point value,” for example 53 with the IEEE-754 binary code.
Of course, int has a range of [INT_MIN ... INT_MAX] . The range must be at least [-32767 ... + 32.767].
When, mathematically, power(FLT_RADIX, DBL_MANT_DIG) >= INT_MAX , there are no problems with the conversion. This applies to all relevant C. compilers.
source share