* @brief Extract mantissa and exponent of a float value. * * @param v The input value. * @param[out] expo The output exponent. * * @return The mantissa. */
| 466 | * @return The mantissa. |
| 467 | */ |
| 468 | static inline float frexp(float v, int* expo) |
| 469 | { |
| 470 | unsigned int iv = astc::float_as_uint(v); |
| 471 | *expo = ((iv >> 23) & 0xFF) - 126; |
| 472 | iv = (iv & 0x807fffff) | 0x3f000000; |
| 473 | return astc::uint_as_float(iv); |
| 474 | } |
| 475 | |
| 476 | /** |
| 477 | * @brief Compute the product of two sizes. |
no test coverage detected