truncfp.c

来自「mips架构的bootloader,99左右的版本 但源代码现在没人更新了」· C语言 代码 · 共 25 行

C
25
字号
/************************************************************* * File: lib/truncfp.c * Purpose: Used to truncate floating-point values * Author: Phil Bunce (pjb@carmel.com) * Revision History: *	980818	Moved here from vsprintf.c */trunc_fp(fmt,p,n)char fmt,*p;int n;{int i;if (*p == '-') p++;p += 2 + n;while (*p != 0 && *p != 'e' && *p != 'E') strdchr(p);if (fmt == 'e') *p = 'e';p += 2;while (*p != 0 && *p == '0') strdchr(p);if (strlen(p) == 0) strichr(p,'0');if (strlen(p) == 1) strichr(p,'0');}

⌨️ 快捷键说明

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