Last active
August 17, 2017 02:58
-
-
Save pandax381/65662c409366b7887e406ade783a4bfb to your computer and use it in GitHub Desktop.
Berkeley SoftFloat test
This file contains 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 "softfloat.h" | |
int | |
main (void) { | |
float32_t a = ui32_to_f32(0x3F800000); /* 1.0 */ | |
float32_t b = ui32_to_f32(0x40000000); /* 2.0 */ | |
float32_t c = f32_add(a, b); | |
fprintf(stderr, "0x%lx + 0x%lx = 0x%lx\n", | |
f32_to_ui32(a, softfloat_round_near_even, true), | |
f32_to_ui32(b, softfloat_round_near_even, true), | |
f32_to_ui32(c, softfloat_round_near_even, true) | |
); | |
return 0; | |
} |
Author
pandax381
commented
Aug 17, 2017
Berkeley SoftFloat (Release 3d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment