### 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::larger_prime(0) == 5);
	CHECK(Math::larger_prime(1) == 5);
	CHECK(Math::larger_prime(2) == 5);
	CHECK(Math::larger_prime(5) == 13);
	CHECK(Math::larger_prime(500) == 769);
	CHECK(Math::larger_prime(1'000'000) == 1'572'869);
	CHECK(Math::larger_prime(1'000'000'000) == 1'610'612'741);
	
	ERR_PRINT_OFF;
	CHECK(Math::larger_prime(2'000'000'000) == 0);
	ERR_PRINT_ON;
}
TEST_CASE_TEMPLATE("[Math] fmod", T, float, double) {
	CHECK(Math::fmod((T)-2.0, (T)0.3) == doctest::Approx((T)-0.2));
	CHECK(Math::fmod((T)0.0, (T)0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fmod((T)2.0, (T)0.3) == doctest::Approx((T)0.2));
	CHECK(Math::fmod((T)-2.0, (T)-0.3) == doctest::Approx((T)-0.2));
	CHECK(Math::fmod((T)0.0, (T)-0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fmod((T)2.0, (T)-0.3) == doctest::Approx((T)0.2));
}
TEST_CASE_TEMPLATE("[Math] fposmod", T, float, double) {
	CHECK(Math::fposmod((T)-2.0, (T)0.3) == doctest::Approx((T)0.1));
	CHECK(Math::fposmod((T)0.0, (T)0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fposmod((T)2.0, (T)0.3) == doctest::Approx((T)0.2));
	CHECK(Math::fposmod((T)-2.0, (T)-0.3) == doctest::Approx((T)-0.2));
	CHECK(Math::fposmod((T)0.0, (T)-0.3) == doctest::Approx((T)0.0));
	CHECK(Math::fposmod((T)2.0, (T)-0.3) == doctest::Approx((T)-0.1));
}
TEST_CASE_TEMPLATE("[Math] fposmodp", T, float, double) {
	CHECK(Math::fposmodp((T)-2.0, (T)0.3) == doctest::Approx((T)0.1));