Use isfinite function instead of finite function
The C function to check if a number is finite is 'isfinite()'. Obviously the 'finite()' function is from C89 and was deprecated with C99 but not yet removed. At least with the default compiler on macosx 12.5 (arm64) the function was removed so we switch to 'isfinite()'.