zoukankan      html  css  js  c++  java
  • frexp()函数

    函数名: frexp   
    功 能: 把一个浮点数分解为尾数和指数   
    原 型:   double frexp( double x, int *expptr );   
    float frexp( float x, int * expptr); // C++ only   
    long double frexp( long double x, int * expptr ); // C++ only   
    参 数:   
    x : 要分解的浮点数据   
    expptr : 存储指数的指针   
    返回值:   返回尾数   
    说 明:   其中 x = 尾数 * 2^指数   
    程序例:   
    // crt_frexp.c   
    // This program calculates frexp( 16.4, &n )   
    // then displays y and n.   
    #include <math.h>   
    #include <stdio.h>   
    int main( void )   
    {  double x, y;   
        int n;   
        x = 16.4;   
        y = frexp( x, &n );   
        printf( "frexp( %f, &n ) = %f, n = %d\n", x, y, n );
    }   
    运行结果:   
    frexp( 16.400000, &n ) = 0.512500, n = 5   
    验证:   16.4 = 0.5125 * 2^5 = 0.5125 * 32
  • 相关阅读:
    搭建ip代理池思想
    maven中央仓库
    git 基本操作
    利用阿里云发送信息
    Ubuntu配置java环境
    mysql 配置
    Quartz中的时间配置
    如何在Maven中配置Spring依赖
    Jquery动态添加/删除表格行和列
    改行做窗纱批发了(浙江绍兴柯桥窗纱)
  • 原文地址:https://www.cnblogs.com/eagleking0318/p/6521321.html
Copyright © 2011-2022 走看看