Commits
Ralph Giles committed d9474d9085a
Cast a factor to maintain precision on 16 bit systems. The multiply would overflow with 16 bit ints. Thanks to Riccardo Micci for pointing out the issue. Thanks to Tim Terriberry for the valid range of the decay argument. Note that ft is unsigned, but always less than 32736, so we could use a 16 bit signed type here if it allows the compiler to produce faster code (with signed 16*16 and 16*32 multiplies). In the absense of actual cycle counts from a real platform, I've left it as an unsigned for the sake of readability. For similar reasons we cast (16384-decay) to a signed integer even though it is also always positive.