### Godot version

4.1.rc3

### System information

Linux 5.10.181-2-MANJARO

### Issue description

`sign(NAN)` and `signf(NAN)` both return `1`. But this doesn't seem right, as `NAN > 0` is false (as all other `NAN` comparison are). These should really return `NAN` not `1`.

### Steps to reproduce

run 
```gdscript
print(sign(NAN), " ", signf(NAN))
```
output is: 
`1 1`

### Minimal reproduction project

N/A
CHECK(Math::fract((T)77.8) == doctest::Approx((T)0.8));
	CHECK(Math::fract((T)-10.1) == doctest::Approx((T)0.9));
}
TEST_CASE_TEMPLATE("[Math] pingpong", T, float, double) {
	CHECK(Math::pingpong((T)0.0, (T)0.0) == doctest::Approx((T)0.0));
	CHECK(Math::pingpong((T)1.0, (T)1.0) == doctest::Approx((T)1.0));
	CHECK(Math::pingpong((T)0.5, (T)2.0) == doctest::Approx((T)0.5));
	CHECK(Math::pingpong((T)3.5, (T)2.0) == doctest::Approx((T)0.5));
	CHECK(Math::pingpong((T)11.5, (T)2.0) == doctest::Approx((T)0.5));
	CHECK(Math::pingpong((T)-2.5, (T)2.0) == doctest::Approx((T)1.5));
}
TEST_CASE_TEMPLATE("[Math] deg_to_rad/rad_to_deg", T, float, double) {
	CHECK(Math::deg_to_rad((T)180.0) == doctest::Approx((T)Math_PI));
	CHECK(Math::deg_to_rad((T)-27.0) == doctest::Approx((T)-0.471239));
	CHECK(Math::rad_to_deg((T)Math_PI) == doctest::Approx((T)180.0));
	CHECK(Math::rad_to_deg((T)-1.5) == doctest::Approx((T)-85.94366927));
}
TEST_CASE_TEMPLATE("[Math] cubic_interpolate", T, float, double) {
	CHECK(Math::cubic_interpolate((T)0.2, (T)0.8, (T)0.0, (T)1.0, (T)0.0) == doctest::Approx((T)0.2));
	CHECK(Math::cubic_interpolate((T)0.2, (T)0.8, (T)0.0, (T)1.0, (T)0.25) == doctest::Approx((T)0.33125));
	CHECK(Math::cubic_interpolate((T)0.2, (T)0.8, (T)0.0, (T)1.0, (T)0.5) == doctest::Approx((T)0.5));
	CHECK(Math::cubic_interpolate((T)0.2, (T)0.8, (T)0.0, (T)1.0, (T)0.75) == doctest::Approx((T)0.66875));
	CHECK(Math::cubic_interpolate((T)0.2, (T)0.8, (T)0.0, (T)1.0, (T)1.0) == doctest::Approx((T)0.8));
	CHECK(Math::cubic_interpolate((T)20.2, (T)30.1, (T)-100.0, (T)32.0, (T)-50.0) == doctest::Approx((T)-6662732.3));
	CHECK(Math::cubic_interpolate((T)20.2, (T)30.1, (T)-100.0, (T)32.0, (T)-5.0) == doctest::Approx((T)-9356.3));
	CHECK(Math::cubic_interpolate((T)20.2, (T)30.1, (T)-100.0, (T)32.0, (T)0.0) == doctest::Approx((T)20.2));
	CHECK(Math::cubic_interpolate((T)20.2, (T)30.1, (T)-100.0, (T)32.0, (T)1.0) == doctest::Approx((T)30.1));
	CHECK(Math::cubic_interpolate((T)20.2, (T)30.1, (T)-100.0, (T)32.0, (T)4.0) == doctest::Approx((T)1853.2));
}
TEST_CASE_TEMPLATE("[Math] cubic_interpolate_angle", T, float, double) {