MiSawa / xq

Pure rust implementation of jq
MIT License
333 stars 18 forks source link

Fix modulo operator on floating point numbers #79

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

The modulo operator of jq truncates lhs/rhs to integers.

MiSawa commented 2 years ago

Awesome, thank you! Honestly I'm not a big fan of this floating-point-number-truncate semantics but that's what jq does, so...

itchyny commented 2 years ago

This is your project so judge yourself to make each features compatible or not. Actually jq has many bugs, or bad behaviors, so 100% compatibility is not the best way to go. I fixed various bugs in gojq and intentionally made some filters incompatible against jq.