I am using IronPython 2.7 integrated into Rhinoceros 5 application.
I am having a strange int()
function result:
import math
angle = 45.0
tangent = math.tan(math.radians(angle))
n = 12*tangent
print "angle: ", angle
print "tangent: ", tangent
print "n: ", n
print "int(n): ", int(n)
Results in:
angle: 45.0
tangent: 1.0
n: 12.0
int(n): 11
So as written above, the int()
function returns 11
not 12
.
I know there are some floating point number issues, but this should not be related with integers?
Does anyone know why is this happening?
Thank you for the reply.
EDIT: I added the code, on how I got the "12.0"