Skip to content

odd negative sign in modulo results #109

@kelvintaywl

Description

@kelvintaywl

Hi!

firstly, thank you so much for this tool.
It's been amazingly helpful for me 🙇 .

I wanted to file an issue about seeing negative values in the modulo (%) result.

To reproduce:

$ csvq -v
csvq version 1.18.1

$ csvq "SELECT (CEIL(13041 / 60) % 60)"
+-------------------------+
| (CEIL(13041 / 60) % 60) |
+-------------------------+
|                     -23 |
+-------------------------+

I was expecting 37 there since CEIL(13041/60) = 217 and 217 % 60 = 37, not -23.

I am thinking this is a possible bug 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions