Created
August 17, 2017 04:02
-
-
Save pandax381/20bc6e972cb787a6db30758200a67730 to your computer and use it in GitHub Desktop.
Berkeley SoftFloat test 2
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 = {0x3F800000}; | |
float32_t b = {0x40000000}; | |
float32_t c = f32_add(a, b); | |
fprintf(stderr, "0x%x (%ld) + 0x%x (%ld) = 0x%x (%ld)\n", | |
(uint32_t)a.v, f32_to_ui32(a, softfloat_round_near_even, true), | |
(uint32_t)b.v, f32_to_ui32(b, softfloat_round_near_even, true), | |
(uint32_t)c.v, f32_to_ui32(c, softfloat_round_near_even, true) | |
); | |
return 0; | |
} |
Author
pandax381
commented
Aug 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment