4 Replies Latest reply on Apr 7, 2016 8:47 AM by czigany

    Can't reverse engineer director math algorithm (myCalculation=1&myFinalNumber*6727714)

    czigany Level 1

      I'm trying to rewrite several old director movies into modern software applications, but have hit a roadblock in trying to rewrite various algorithms because the math in Director isn't making any sense.


      The problem comes about with this line:




      For example, when myFinalNumber = 1258, I am expecting that myCalculation will result in "18463464212", but instead it comes out as "1-126470380". Watching the expression myFinalNumber*6727714 shows the result -126470380.

      How can multiplying two positive numbers result in a negative answer?

      I've tried to work backwards to see if there's any consistency to the results, and haven't been able to find a pattern of what math it is actually performing when it is supposed to be solving 1258*6727714.

      I've tried separating the line out into multiple lines, thinking perhaps the string concatenation was effecting things, but there was no change by doing myFinalNumber*6727714 and then concatenating the 1 in front.

      Is there something stupidly obvious I'm not seeing here? Surely there's some sort of rhyme and reason to how Director handles math equations like this.

      Any insights would be appreciated.