powf for NaN returns 1 (original) (raw)

The powf for floating point numbers seems to have optimization: when base is 1, always return 1. This optimization does not check if exponent is a number, so

1f32.powf(std::f32::NAN) == 1.

This behavior is same for debug and release modes, f32 and f64. playground