in FixAntenna/NetCore/Message/FixTypes.cs [131:184]
public static bool IsInvalidFloat(byte[] buffer, int offset, int count)
{
var limit = offset + count;
if (limit > offset && buffer[offset] == (byte)'-')
{
offset++;
}
if (limit == offset)
{
return true;
}
var mantissa = 0L;
var expCorr = 0;
var isDecPointDetected = false;
while (offset < limit)
{
var ch = buffer[offset++];
if (ch == (byte)'.')
{
if (isDecPointDetected)
{
return true;
}
isDecPointDetected = true;
}
else if (ch < (byte)'0' || ch > (byte)'9')
{
return true;
}
else
{
if (mantissa < MaxMantissaThreshold)
{
mantissa = mantissa * 10L + (ch - '0');
if (isDecPointDetected)
{
expCorr--;
}
}
else
{
if (!isDecPointDetected)
{
expCorr++;
}
}
}
}
return expCorr > MaxExponent || expCorr < MinExponent;
}