[Tutor] Problems with subtraction!
evert.rol at gmail.com
Wed Jul 7 13:59:52 CEST 2010
> The second number should be negative ( I WANT it to be negative). For example:
> print (0 - t)*(t - t) , (0 - t)*(t - t) gives :
> -30895 -935636
> And in the python shell:
> >>> -30895 -935636
No, because you have to *subtract* the second answer from the first ( according to your print statement: print (0 - t)*(t - t) - (0 - t)*(t - t) ). So:
>>> -30895 - -935636
If you want it to be negative, check the order of your coordinates: maybe you need to interchange two variables between one set of parentheses. Or maybe you need to subtract absolute values instead (sorry, too lazy to do the math to find out what is correct).
More information about the Tutor