Grasshopper

algorithmic modeling for Rhino

Not sure if necessarily a bug. I am often using sift components for splitting data and combining later. I guess usually I am multiplying or dividing this data so of course if null is considered as a zero no matter what it is multiplied or divided by it will stay as null (although if following the logic of being added to or subtracted to, it should turn into a zero rather than stay null).

However, if you add or subtract from null it does return you an actual value.

So currently in GH, null + 10 = 10. Yet, null x 10 = null. Seems either null+10 should also equal null or null x 10 should equal 0. The results seem inconsistent but maybe I am missing some reason for it. I think it makes more sense that null in any math will always result still in null, since we have the handy replace null component if we do not want it and nulls are great place holders for things like sifting. 

See attached screenshot:

Views: 1026

Replies to This Discussion

Oops, it's a bug. I did this becaue you can add more inputs to addition and I didn't want the component to stop working when you add one, so no input is treated as additive identity. Clearly it needs to distinguish between no input and a null input.

Hi David.

This still seems to be present in GH 1.0.004, and can actually be a major source of (easily overlooked) errors. Is there a better solution to this other than writing our own code blocks to deal with null items or empty branches?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service