宏或函数从给定的符号,尾数和指数构造一个float(double)? [英] Macro or function to construct a float (double) from a given sign, mantissa and exponent?

查看:99
本文介绍了宏或函数从给定的符号,尾数和指数构造一个float(double)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何宏或函数从给定的符号,尾数和指数(所有二进制或十进制)构造一个float(double),它返回一个有效的float(double)数字或返回NaN,如果输入指定的数字是不能表示为float(double)?

Is there any macro or function to construct a float (double) from a given sign, mantissa and exponent (all binary or decimal) that either returns a valid float (double) number or returns NaN if the number specified by input is not representable as float (double)?

推荐答案

您要查找的函数是 ldexp

The function you're looking for is ldexp.

这篇关于宏或函数从给定的符号,尾数和指数构造一个float(double)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆