From 7b21727285e50b0b050c4ddd70d07542229c5366 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:03 -0700 Subject: init --- c/float.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 c/float.c (limited to 'c/float.c') diff --git a/c/float.c b/c/float.c new file mode 100644 index 0000000..f02a177 --- /dev/null +++ b/c/float.c @@ -0,0 +1,11 @@ +#include +#include + +// this showcases floating point innaccuracy due to needing to represent them in binary + +void main() { + float ye = 6.28; + printf("%.4f\n", ye); + printf("%.8f\n", ye); + printf("%.12f\n", ye); +} -- cgit v1.2.3