Last active
June 18, 2024 13:33
-
-
Save DocBohn/aaa9b5318cd50babe007b5ca327cef77 to your computer and use it in GitHub Desktop.
Demonstration of IEEE 754's decimal floating point type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <unistd.h> | |
| #define MS_PER_uS 1000 | |
| void terminating_loop(void) { | |
| _Decimal32 x; | |
| int duration = 100 * MS_PER_uS; | |
| for (x = 0.0df; x != 10.0df; x += 0.1df) { | |
| printf("x = %Ha\n", x); | |
| usleep(duration); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment