在C / C 80位浮点运算++ [英] 80 bit floating point arithmetic in C/C++

查看:293
本文介绍了在C / C 80位浮点运算++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让承担, B _int64 变量。
需要计算的sqrt((长双)一)* SQRT((长双)B)高precision 80位浮点。

Let assume a, b are _int64 variables. Need to calculate sqrt((long double)a)*sqrt((long double)b) in high precision 80 bit floating point.

为例。 (__的Int64)(开方((长双)一)* SQRT((长双)一)+ 0.5)!=​​ A 在很多情况下是应该的。

Example. (__int64)(sqrt((long double)a)*sqrt((long double)a) + 0.5) != a in many cases as should be.

的win32哪个C / C ++编译器可以管理80位浮点运算?

Which win32 C/C++ compiler can manage 80 bit floating point arithmetic?

推荐答案

您可能不应该使用浮点取一个整数的平方根时,要特别长双这是不好的支持,可能会在某些系统上有一个近似(不准确) sqrtl 。相反,查找整数的平方根算法。

You probably should not be using floating point to take the square root of an integer, especially long double which is poorly supported and might have an approximate (not accurate) sqrtl on some systems. Instead look up integer square root algorithms.

这篇关于在C / C 80位浮点运算++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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