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
  • 相关阅读:
    RHEL安装oracle客户端(版本为11.2)
    为服务器设置固定IP地址
    RHEL配置本地yum
    网线水晶头内线排序
    《汇编语言(第三版)》王爽著----读书笔记01
    kali系统越来越大解决
    Markdown入门简介
    Linux之tail命令
    Linux之df命令
    Linux命令
  • 原文地址:https://www.cnblogs.com/eagleking0318/p/6521321.html
Copyright © 2011-2022 走看看