### 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::ease(0.1, -0.5) == doctest::Approx(0.2236067977));
	CHECK(Math::ease(0.1, -1.0) == doctest::Approx(0.1));
	CHECK(Math::ease(0.1, -2.0) == doctest::Approx(0.02));
	CHECK(Math::ease(-1.0, 1.0) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, 2.0) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, 0.5) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, 0.0) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, -0.5) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, -1.0) == doctest::Approx(0));
	CHECK(Math::ease(-1.0, -2.0) == doctest::Approx(0));
}
TEST_CASE("[Math] snapped") {
	CHECK(Math::snapped(0.5, 0.04) == doctest::Approx(0.52));
	CHECK(Math::snapped(-0.5, 0.04) == doctest::Approx(-0.48));
	CHECK(Math::snapped(0.0, 0.04) == doctest::Approx(0));
	CHECK(Math::snapped(128'000.025, 0.04) == doctest::Approx(128'000.04));
	CHECK(Math::snapped(0.5, 400) == doctest::Approx(0));
	CHECK(Math::snapped(-0.5, 400) == doctest::Approx(0));
	CHECK(Math::snapped(0.0, 400) == doctest::Approx(0));
	CHECK(Math::snapped(128'000.025, 400) == doctest::Approx(128'000.0));
	CHECK(Math::snapped(0.5, 0.0) == doctest::Approx(0.5));
	CHECK(Math::snapped(-0.5, 0.0) == doctest::Approx(-0.5));
	CHECK(Math::snapped(0.0, 0.0) == doctest::Approx(0.0));
	CHECK(Math::snapped(128'000.025, 0.0) == doctest::Approx(128'000.0));
	CHECK(Math::snapped(0.5, -1.0) == doctest::Approx(0));
	CHECK(Math::snapped(-0.5, -1.0) == doctest::Approx(-1.0));
	CHECK(Math::snapped(0.0, -1.0) == doctest::Approx(0));
	CHECK(Math::snapped(128'000.025, -1.0) == doctest::Approx(128'000.0));
}
TEST_CASE("[Math] larger_prime") {