All I can tell you is where -3 comes from.
>From http://www.voip-info.org/wiki/view/Asterisk+Expressions :
REMAINDER(x,y) computes the remainder of dividing x by y. The return value
is x - n*y, where n is the value x/y, rounded to the nearest integer. If
this quotient is 1/2, it is rounded to the nearest even number.

-3 comes from:
n = x/y = 957/60 = 15.95 which rounds to 16
n*y = 16*60 = 960
x - 960 = 957-960 = -3

I'm not mathematically gifted either but I think the n is the problem. it
shouldn't be the rounded result it should be the integer part of x/y (n=15)

Can you just use modulo instead: ${MATH(${myNum}%60,int)}
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to