Merge pull request #3216 from divayprakash/fix-printf

Fix printf, closes #2730
This commit is contained in:
Divay Prakash 2018-09-13 00:23:22 +05:30 committed by GitHub
commit 7989696adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,8 +388,8 @@ int main (int argc, char** argv)
// respectively, use the CHAR_MAX, SCHAR_MAX and UCHAR_MAX macros from <limits.h>
// Integral types can be cast to floating-point types, and vice-versa.
printf("%f\n", (float)100); // %f formats a float
printf("%lf\n", (double)100); // %lf formats a double
printf("%f\n", (double) 100); // %f always formats a double...
printf("%f\n", (float) 100); // ...even with a float.
printf("%d\n", (char)100.0);
///////////////////////////////////////