Inf or -Inf requires the max exponent, and the significand must be zero. Otherwise it is NaN (which seems like a waste of bits. Looked it up: turns out there are both quiet and signaling NaNs, and they can contain a payload in the significand bits.)
Due to the biased exponent, that's just one or two bits off
| value | float as int |
|---|---|
| 1.0 | 0x3f800000 |
| Inf | 0x7f800000 |
| -Inf | 0xff800000 |
You can print the float-as-int
Serial.println(*reinterpret_cast<int32_t*>(&mem_valuefloat), HEX);
How are you showing the value? Serial.print does not print the negative sign unless it's a valid number
size_t Print::printFloat(double number, int digits)
{
if (digits < 0)
digits = 2;
size_t n = 0;
if (isnan(number)) return print("nan");
if (isinf(number)) return print("inf");
if (number > 4294967040.0) return print ("ovf"); // constant determined empirically
if (number <-4294967040.0) return print ("ovf"); // constant determined empirically
// Handle negative numbers
if (number < 0.0)
{
n += print('-');
number = -number;
}
Also the offset of korr_A[3][4] is 252, which means it ends just before offset 256. (Might be more of a lead if it started there.) What does setMemoryType do?