dgryski / go-tsz

Time series compression algorithm from Facebook's Gorilla paper
BSD 2-Clause "Simplified" License
541 stars 66 forks source link

Some questions about source code #25

Open sunism opened 2 years ago

sunism commented 2 years ago

there are two questions about source code:

  1. tsz.go
    
    // clamp number of leading zeros to avoid overflow when encoding
        if leading >= 32 {
            leading = 31
        }
the value is float 64 , leading zero is will between 0 and 64, why there use 32?
2. tsz.go

if s.leading != ^uint8(0) && leading >= s.leading && trailing >= s.trailing {


what ahout the meaning of ```s.leading != ^uint8(0)  ``` ??

I really hope to hear from you