### 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
for (int i = 30; i >= 0; i--) {
		if (p_number & (1 << i)) {
			return i + 1;
		}
	}
	return 0;
}
template <typename T>
constexpr T floor_log2(T x) {
	return x < 2 ? x : 1 + floor_log2(x >> 1);
}
template <typename T>
constexpr T get_num_bits(T x) {
	return floor_log2(x);
}
#if defined(__GNUC__)
#define BSWAP16(x) __builtin_bswap16(x)
#define BSWAP32(x) __builtin_bswap32(x)
#define BSWAP64(x) __builtin_bswap64(x)
#else
static inline uint16_t BSWAP16(uint16_t x) {