Wrong Division Operation in Python Script

Hello everyone I was checking why my code does not do and offset that I was writing in the code and I find this thing, do you know why in the python script is not doing any simple division right, I am doing something wrong?.

# The inputs to this node will be stored as a list in the IN variables.
OFacade = IN[0]
GridO= IN[1]
RefDist = 25
#Obtain curve on the bottom surface for form

EscFloor= float(((RefDist-(OFacade/100))/RefDist))

#Form for Grid Geometry
EscSGrid= ((RefDist-((OFacade+GridO)/100))/RefDist)
	
# Assign your output to the OUT variable.
OUT = EscFloor, EscSGrid,(OFacade/100)

Try adding a .0 on the RefDist and 100. I have seen behavior like this before and the single decimal should force the a double.

2 Likes

You are totally right thanks, with that now is working :grinning:

1 Like

this is a python 2 vs python 3 thing.

2 Likes

Thanks for the background, ran into this originally in C# quite a while back and just about went crazy!! Now I use the decimal no matter what just to be safe!