copysignf.c\math\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/math/copysignf.c
blob: 0af6ae9b2155da70412f7406e67ab968218d2265 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include <math.h>
#include <stdint.h>
float copysignf(float x, float y)
{
	union {float f; uint32_t i;} ux={x}, uy={y};
	ux.i &= 0x7fffffff;
	ux.i |= uy.i & 0x80000000;
	return ux.f;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月01日 10:09:25 +0000

AltStyle によって変換されたページ (->オリジナル) /