From Stream Compression documentation:

.....new stream data is automatically compressed, except for the following cases, where the data is not suitable for compression:

  • The stream can be stored in a single chunk less than 1024 characters long.
  • The stream is already compressed, that is, the first chunk of data matches a typical compressed file format, such as JPEG, MP3, or ZIP.
  • The first 4KB of the stream cannot be compressed by at least 20 percent.

I guess your test runs into these cases.

True, but the problem definition is:

If both fields are numeric and the result of subtraction of field1-field2 is positive.

My understanding/interpretation is that the subtraction and further test should be performed only "If both fields are numeric", so the code should check that condition.

If the first part of the problem (If both fields are numeric) is irrelevant....then the question/problem definition is misleading.