2.94 Float Twice
★★★
Problem:
Following the bit-level floating-point coding rules, implement the function with the following prototype:
For floating-point number f, this function computes 2.0 * f. If f is NaN, your function should simply return f.
Test your function by evaluating it for all 2^32 values of argument f and comparing the result to what would be obtained using your machine's floating-point operations.
Code:
Last updated