How to use cmath Bessel functions with Mac

So I am using Mac with the developer tools coming from XCode and according to other answers I should compile using something like: g++ –std=c++17 test.cpp -o test or using clang++ but I still I am having trouble making the script find the special functions. What else can I try? Minimum example #include <cmath> #include… Read More How to use cmath Bessel functions with Mac

Why is abs(x)+abs(y) different from sqrt(x*x + y*y)

I was making a Physics Engine in C++ when I noticed that when I replace: float absDistance = sqrt(vectorDistance.x * vectorDistance.x + vectorDistance.y * vectorDistance.y); With: float absDistance = abs(vectorDistance.x) + abs(vectorDistance.y) Different things happen. I’m using the library <cmath> I looked at a lot of stack exchanges but I couldn’t find anyone saying they’re… Read More Why is abs(x)+abs(y) different from sqrt(x*x + y*y)