日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java fmal_fma、fmaf、fmal

發布時間:2024/3/12 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java fmal_fma、fmaf、fmal 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

fma、fmaf、fmalfma, fmaf, fmal

9/1/2020

本文內容

將兩個值相乘,添加第三個值,然后對結果進行舍入,而不會因中間舍入而丟失任何精度。Multiplies two values together, adds a third value, and then rounds the result, without losing any precision due to intermediary rounding.

語法Syntax

double fma(

double x,

double y,

double z

);

float fma(

float x,

float y,

float z

); //C++ only

long double fma(

long double x,

long double y,

long double z

); //C++ only

float fmaf(

float x,

float y,

float z

);

long double fmal(

long double x,

long double y,

long double z

);

#define fma(X, Y, Z) // Requires C11 or higher

參數Parameters

x-bladex

要相乘的第一個值。The first value to multiply.

誤差y

要相乘的第二個值。The second value to multiply.

zz

要相加的值。The value to add.

返回值Return Value

返回 (x * y) + z。Returns (x * y) + z. 然后使用當前舍入格式舍入返回值。The return value is then rounded using the current rounding format.

否則,可能返回以下值之一:Otherwise, may return one of the following values:

問題Issue

返回Return

x = 無限大、 y = 0 或x = INFINITY, y = 0 or

x = 0、 y = 無限大x = 0, y = INFINITY

NaNNaN

x 或 y = 精確的±無限大, z = 無窮大,正負號x or y = exact ± INFINITY, z = INFINITY with the opposite sign

NaNNaN

x 或 y = NaNx or y = NaN

NaNNaN

not (x = 0, y= 不定) , z = NaNnot (x = 0, y= indefinite) and z = NaN

not (x= 不定, y= 0) , z = NaNnot (x=indefinite, y=0) and z = NaN

NaNNaN

溢出范圍錯誤Overflow range error

± HUGE_VAL、± HUGE_VALF 或± HUGE_VALL±HUGE_VAL, ±HUGE_VALF, or ±HUGE_VALL

下溢范圍錯誤Underflow range error

舍入后的正確值。correct value, after rounding.

按 _matherr 中所指定的報告錯誤。Errors are reported as specified in _matherr.

備注Remarks

由于 c + + 允許重載,因此你可以調用采用并返回和類型的 fma 的重載 float long double 。Because C++ allows overloading, you can call overloads of fma that take and return float and long double types. 在 C 程序中,除非使用 宏調用此函數,否則 fma 始終采用并返回 double 。In a C program, unless you're using the macro to call this function, fma always takes and returns a double.

如果使用 fma() 宏,則參數的類型將決定選擇哪個版本的函數。If you use the fma() macro, the type of the argument determines which version of the function is selected. 有關詳細信息,請參閱 類型-泛型數學 。

此函數計算值就好像它采取了無限精度,然后將最終結果舍入。This function computes the value as though it were taken to infinite precision, and then rounds the final result.

默認情況下,此函數的全局狀態的作用域限定為應用程序。By default, this function's global state is scoped to the application. 若要更改此項,請參閱 CRT 中的全局狀態。

要求Requirements

函數Function

C 標頭C header

C++ 標頭C++ header

fma、 fmaf、 fmalfma, fmaf, fmal

fma 宏fma macro

有關其他兼容性信息,請參閱兼容性。For additional compatibility information, see Compatibility.

另請參閱See also

總結

以上是生活随笔為你收集整理的java fmal_fma、fmaf、fmal的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。