News for hackers. Stuff that matters.
Re:Implementing the Exponential Function by nwallin on Sunday June 28, 2020 @07:34PM (#23672889)
IMHO it's a bit cheeky to use exp2 from the standard library. It's likely got all the same math exp does. Fortunately, if you know that your exponent is an integer, there's a constant time version. It's 5 instructions: add, and, shift, mov, ret.

https://godbolt.org/z/KNyoVd

Re:Implementing the Exponential Function by fractionalhare on Sunday June 28, 2020 @08:09PM (#23673106)
Excellent, thank you! I agree, I had the use of `exp2(x)` on my list of implementation nits to revisit. I'm going to revise to use your method and credit the comment.
Re:Implementing the Exponential Function by _0ffh on Monday June 29, 2020 @05:03AM (#23675756)
I think you can spare the "and", because if you overflow the exponent field, the result will be wrong either way.