⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modf.c

📁 Minix比较全的源码
💻 C
字号:
/*libc/ieee_float/modf.cCreated:	Oct 14, 1993 by Philip Homburg <philip@cs.vu.nl>Implementation of modf that directly manipulates the exponent bits in anieee float*/#include <sys/types.h>#include <math.h>#include "ieee_float.h"double modf(value, iptr)double value;double *iptr;{	struct f64 *f64p;	double tmp;	int exp;	int mask_bits;	u32_t mant;	f64p= (struct f64 *)&value;	exp= F64_GET_EXP(f64p);	exp -= F64_EXP_BIAS;	if (exp < 0)	{		*iptr= 0;		return value;	}	mask_bits= 52-exp;	if (mask_bits <= 0)	{		*iptr= value;		return 0;	}	tmp= value;	if (mask_bits >= 32)	{		F64_SET_MANT_LOW(f64p, 0);		mask_bits -= 32;		mant= F64_GET_MANT_HIGH(f64p);		mant &= ~((1 << mask_bits)-1);		F64_SET_MANT_HIGH(f64p, mant);	}	else	{		mant= F64_GET_MANT_LOW(f64p);		mant &= ~((1 << mask_bits)-1);		F64_SET_MANT_LOW(f64p, mant);	}	*iptr= value;	return tmp-value;}/* * $PchId: modf.c,v 1.3 1996/02/22 21:01:39 philip Exp $ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -