mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:35:35 +08:00
36 lines
800 B
HTML
36 lines
800 B
HTML
<h1>数学函数 - frexp</h1>
|
||
|
||
|
||
<p>原型:extern float frexp(float x, int *exp);</p>
|
||
|
||
<p>用法:#include <math.h></p>
|
||
|
||
<p>功能:把浮点数x分解成尾数和指数。</p>
|
||
|
||
<p>说明:x=m*2^exp,m为规格化小数。返回尾数m,并将指数存入exp中。</p>
|
||
|
||
举例:<pre><code class="language-c">
|
||
|
||
// frexp.c
|
||
|
||
#include <syslib.h>
|
||
#include <math.h>
|
||
|
||
main()
|
||
{
|
||
float x;
|
||
int exp;
|
||
|
||
clrscr(); // clear screen
|
||
textmode(0x00); // 6 lines per LCD screen
|
||
|
||
x=frexp(64.0,&exp);
|
||
printf("64=%.2f*2^%d",x,exp);
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</code></pre>相关函数:<a href="ldexp.html">ldexp</a>,<a href="modf.html">modf</a>
|
||
|