mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 10:15:03 +00:00
* 引入cargo * 取消对Cargo.lock的跟踪 * 解决vscode报错问题 * new: rust的代码能够调用c语言的printk_color * 1、将原本run.sh的工作拆解,变为几个不同的make命令 2、在docker镜像中编译rust * 更改workflow * update workflow * new: 解决workflow无法通过编译的问题
30 lines
509 B
C
30 lines
509 B
C
#include <common/math.h>
|
|
#include <common/sys/types.h>
|
|
#include "libm.h"
|
|
|
|
double fabs(double x)
|
|
{
|
|
union
|
|
{
|
|
double f;
|
|
uint64_t i;
|
|
} u = {x};
|
|
u.i &= -1ULL / 2;
|
|
return u.f;
|
|
}
|
|
|
|
|
|
#if __LDBL_MANT_DIG__ == 53 && __LDBL_MAX_EXP__ == 1024
|
|
long double fabsl(long double x)
|
|
{
|
|
return fabs(x);
|
|
}
|
|
#elif (__LDBL_MANT_DIG__ == 64 || __LDBL_MANT_DIG__ == 113) && __LDBL_MAX_EXP__ == 16384
|
|
long double fabsl(long double x)
|
|
{
|
|
union ldshape u = {x};
|
|
|
|
u.i.se &= 0x7fff;
|
|
return u.f;
|
|
}
|
|
#endif |