### 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::fposmodp((T)0.0, (T)0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fposmodp((T)2.0, (T)0.3) == doctest::Approx((T)0.2));
	CHECK(Math::fposmodp((T)-2.0, (T)-0.3) == doctest::Approx((T)-0.5));
	CHECK(Math::fposmodp((T)0.0, (T)-0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fposmodp((T)2.0, (T)-0.3) == doctest::Approx((T)0.2));
}
TEST_CASE("[Math] posmod") {
	CHECK(Math::posmod(-20, 3) == 1);
	CHECK(Math::posmod(0, 3) == 0);
	CHECK(Math::posmod(20, 3) == 2);
	CHECK(Math::posmod(-20, -3) == -2);
	CHECK(Math::posmod(0, -3) == 0);
	CHECK(Math::posmod(20, -3) == -1);
}
TEST_CASE("[Math] wrapi") {
	CHECK(Math::wrapi(-30, -20, 160) == 150);
	CHECK(Math::wrapi(30, -20, 160) == 30);
	CHECK(Math::wrapi(300, -20, 160) == 120);
	CHECK(Math::wrapi(300'000'000'000, -20, 160) == 120);
}
TEST_CASE_TEMPLATE("[Math] wrapf", T, float, double) {
	CHECK(Math::wrapf((T)-30.0, (T)-20.0, (T)160.0) == doctest::Approx((T)150.0));
	CHECK(Math::wrapf((T)30.0, (T)-2.0, (T)160.0) == doctest::Approx((T)30.0));
	CHECK(Math::wrapf((T)300.0, (T)-20.0, (T)160.0) == doctest::Approx((T)120.0));
	CHECK(Math::wrapf(300'000'000'000.0, -20.0, 160.0) == doctest::Approx((T)120.0));
	
	CHECK(Math::wrapf((float)15'000'000.0, (float)-20.0, (float)160.0) == doctest::Approx((T)60.0));
}
TEST_CASE_TEMPLATE("[Math] fract", T, float, double) {
	CHECK(Math::fract((T)1.0) == doctest::Approx((T)0.0));