Division: changes of behavior after GHPY compilation


Hello
I have a problem
This component works properly before compiling
But after compiling the output it makes a mistake
What is the reason for this bug? Thank you.

Hi @amirrgoli

I moved your response to a new topic.

We will need some more background in order to be able to tell something useful.

  • an example
  • the exact method of compiling
  • if you use libraries

i used method 1 for compiling
from math import sqrt,pi,e,log
from ghpythonlib.components import ConstructDomain,Range,ConstructPoint,Interpolate,RuledSurface,Area

example.gh (4.7 KB)
example.ghpy (36 KB)

Thank you

Sorry, this is probably an old future vs. old division.
4/3 should be written as “4.0/3.0”. The same for all other places where divisions come up.

The default compiler compiles with the default division of Python. An alternative fix, is that you add:
from __future__ import division
to the beginning of the file.

Python 3 will fix this.
I also added an issue to our bugtracker: RH-52820, but this will be fixed by a Python update I think.

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like

A post was split to a new topic: Problem locating Arduino