At least in MySQL v5.1.73 (CentOS 6.6), MOD() function returns a bogus result... unless someone can explain how this is actually correct.
mysql> select MOD(-385.4784399 ,1440);
+-------------------------+
| MOD(-385.4784399 ,1440) |
+-------------------------+
| -385.4784399 |
+-------------------------+
1 row in set (0.01 sec)
Is this the best alternative?
mysql> select -385.478439885319 - 1440 * FLOOR(-385.478439885319/1440);
+----------------------------------------------------------+
| -385.478439885319 - 1440 * FLOOR(-385.478439885319/1440) |
+----------------------------------------------------------+
| 1054.521560114681 |
+----------------------------------------------------------+
1 row in set (0.00 sec)
I think this will work as well, but it's all going the long way around to do something simple.
mysql> select MOD((MOD(-385.478439885319, 1440) + 1440), 1440);
+--------------------------------------------------+
| MOD((MOD(-385.478439885319, 1440) + 1440), 1440) |
+--------------------------------------------------+
| 1054.521560114681 |
+--------------------------------------------------+
1 row in set (0.00 sec)