It is executed both in Objective-C (Xcode) and in Python (terminal) and (1/6)*(66.900009-62.852596)is equal to zero. Does anyone know why this is? Shouldn't it be 0.26246?
(1/6)*(66.900009-62.852596)
You do integer arithmetic on 1/6, and gender 1/6- 0. Try it instead 1.0/6.
1/6
0
1.0/6
1/6is an integer division that becomes 0. Try to use instead 1.0/6.
, from __future__ import division :
from __future__ import division
>>> from __future__ import division >>> (1/6)*(66.900009-62.852596) 0.6745688333333331
, Python 3.