ADQL MOD

Dave Morris dave.morris at metagrid.co.uk
Wed Jul 6 11:44:25 CEST 2016


On 2016-07-06 09:49, Marco Molinaro wrote:
> 
> I indeed think it is (R)DBMS implementation dependent, maybe one more
> point to check with Dave's Cosmopterix.
> 
> A quick search in the SQL standard discussions online seems to point 
> out
> that A%B=R is valid with R having the same sign as A and ABS(R) being
> smaller than ABS(B), plus the counter check that A=B*K+R where K is 
> some
> integer value (out of A/B).
> 

Tested with PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and 
Oracle.

All of them behave as above, for mod(A,B) then R has the same sign as A, 
irrespective of the sign of B.

https://github.com/ivoa/cosmopterix/wiki/MOD-for-negative-numbers

Dave

--------
Dave Morris
Software Developer
Wide Field Astronomy Unit
Institute for Astronomy
University of Edinburgh
--------




More information about the dal mailing list