mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-10 14:48:25 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
8
libc/math/copysign.c
Normal file
8
libc/math/copysign.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "libc/math/libm.h"
|
||||
|
||||
double copysign(double x, double y) {
|
||||
union {double f; uint64_t i;} ux={x}, uy={y};
|
||||
ux.i &= -1ULL/2;
|
||||
ux.i |= uy.i & 1ULL<<63;
|
||||
return ux.f;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue