Re:Don’t assume that safety comes for free: a Swift case study
by planteen on Tuesday December 06, 2016 @01:49PM
(#13117170)
I had a nasty bug like that once as well. It was in some FPGA logic written in VHDL with an overflow on a FIR filter. Recreating the problem was very difficult since it only happened near max signal power with a noisy input. The correct solution there was to saturate, not wrap, which is almost always the case in DSP code.
The fact that Swift defaults to checking for overflow should be treated as good news.