fma(a, b, c); |
Function fma() of cmath library accepts three parameters: a, b – for multiplying this values , c – to add value.
Returns the value of a * b + c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include <iostream> #include <cmath> int main() { float a = 2; float b = 2; float c = 3; float result = 0; result = fma(a, b, c); std::cout << result << std::endl; } |
Execution result ( 2 * 2 + 3):