ClickHouse/libs/libglibc-compatibility/musl/__math_divzerof.c

18 lines
349 B
C
Raw Normal View History

2019-08-01 03:20:54 +00:00
#include <stdint.h>
/* fp_barrier returns its input, but limits code transformations
as if it had a side-effect (e.g. observable io) and returned
an arbitrary value. */
static inline float fp_barrierf(float x)
{
volatile float y = x;
return y;
}
float __math_divzerof(uint32_t sign)
{
return fp_barrierf(sign ? -1.0f : 1.0f) / 0.0f;
}