use memcpy in test-double-float.c
This commit is contained in:
parent
0b206788dc
commit
eab8335e33
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <immintrin.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion"
|
||||
|
@ -32,8 +33,8 @@ inline static float silu_float(float x) {
|
|||
int main(void) {
|
||||
uint32_t x = UINT32_MAX;
|
||||
do {
|
||||
float *y = (float *)&x;
|
||||
float f = *y;
|
||||
float f;
|
||||
memcpy(&f, &x, sizeof(x));
|
||||
assert(!isfinite(f) || (round_orig(f) == round_float(f)));
|
||||
} while (x--);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue