📄 xfmod.c
字号:
/* xfmod.c CCM mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU general * public license. ( See the gpl.license file for details.) * ------------------------------------------------------------------------ */#include "xpre.h"struct xpr xfmod(s,t,p)struct xpr s,t; int *p;{ struct xpr h; unsigned short *q,*ph; short k; h=xdiv(s,t); ph=(unsigned short *)&h; k=(*ph&m_exp)-bias; if(k>=0){ rshift(31-k,ph+1,2); q=(unsigned short *)p; *q= *(ph+1); *(q+1)= *(ph+2); } else *p=0; if(*p){ if(*ph&m_sgn) s=xadd(s,xmul(t,inttox(*p)),0); else s=xadd(s,xmul(t,inttox(*p)),1); } return s;}struct xpr xfrex(s,p)struct xpr s; int *p;{ unsigned short *ps=(unsigned short *)&s,u; *p=(*ps&m_exp)-bias+1; u= *ps&m_sgn; *ps=bias-1; *ps|=u; return s;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -