Skip to content

Fix crash with NaN solutions in debug mode

Andre Offringa requested to merge stable-polar-function into master

Function std::polar was used to convert amplitude,phase to real,imag. However, amplitudes can be NaN, in which case std::polar has undefined behaviour. In debug mode, std::polar does an assert(amplitude >= 0), causing it to crash on NaN amplitudes. This MR adds a stable Polar function that has defined NaN results.

Merge request reports

Loading