Complex Numbers Exercise Requires Too Much Precision

I’ve encountered this on several different language track where the Exp tests are just requiring too much precision. In general, it is not a good idea to require exact values for floating point numbers, especially something this is using transcendental functions. Specifically, I encountered this with PowerShell, where the sine of pi comes out to something around 1.2e-16 instead of 0. Tests like this should use approximately equal to instead of exactly equal to (like pytest.approx() for pytest). I know that not all test frameworks support this. For example, I didn’t see anything like that for Pester. However, something like taking the actual and expected answers and rounding them to some predefined precision before comparing them would be advisable.

30 tracks implement this exercise. Which tracks did you encounter this on besides PowerShell?

Hmm, I thought there were others, but I just checked, and it appears that PowerShell is the only one where I’m seeing this problem. I’ve also done this exercise on C++, JavaScript, and Python. All of those languages seem to check for approximately equal.