y-scope / clp

Compressed Log Processor (CLP) is a free log management tool capable of compressing text logs and searching the compressed logs without decompression.

Home Page:https://yscope.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Floating numbers are not correctly encoded when using IR four-byte encoding

LinZhihao-723 opened this issue · comments

Bug

When using CLP IR four-byte encoding methods to encode a message that contains a floating point number, the decoded message differs from the original message:
Message before encoding (raw text): fps=60.000004
Message after decoding (from the encoded IR): fps=.0
The errors are caught with multiple different floating point numbers, while the decoded results are all being .0.

CLP version

cb6058c

Environment

Ubuntu 18.04
macOS 12.5

Reproduction steps

  1. Encodes the following log message using CLP IR four-byte encoding method:
    fps=60.000004
  2. Decodes the encoded message back to the raw text using CLP IR four-byte decoding methods.