Skip to content
Advertisement

Real, mathematical “modulo” operation in Postgres?

In Ruby:

In Postgres:

I can easily write one myself, but I’m curious whether Postgres has a real modulus operation, as opposed to remainder after division.

Advertisement

Answer

will return 22 instead of -2

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement