I have two BP’s which subdivide a line to pieces with random size.
This one return wrong result:
Here I just separate everything to functions:
What the reason? Why in the same calculation I got different results?
I have two BP’s which subdivide a line to pieces with random size.
This one return wrong result:
Here I just separate everything to functions:
What the reason? Why in the same calculation I got different results?
just one point that popup into my eye at first glance:
it’s me or you are using a random float in range ^^
I don’t understand how you excpect to get same result while using some randomness. (except if you ensure to force the seed and all the thing to kill the randomness)
sorry didn’t look further that.
Oh, it easy to explain I wanna subdivide a ‘line’ let say on few piece with a different size, here how is this algorithm works:
In the end you will have an array with random values which in total will be equal your original value, used as a length of the line
Here is an example of the output:
As you can see ORIGINAL VALUE and ARRAY VAL TOTAL is equal
P.S. - sometimes result could be like that: 2000.000122, 1999.999878; but I don’t think that it’s much important, if it is you can just restart an algorithm
ok I understand what your code’s doing. And what do you mean, by not guetting same result
I know from where it should comes, but not really good at explaining it.
BP works with float. I guess just round-off error with the decimal floating-point ( Decimal floating point - Wikipedia ). (and also fact that computer use binary - in base 2 round number aren’t the same that in base 10 )
As u can see I have two different implementation of this algorithm:
Here my BP files: LineSubdevision.zip (65.4 KB)
P.S. - there is a two files: ‘LineSubdivision’ which return a wrong result and ‘LineSubdevision2’ which works fine
I wasn’t wrong when I pointed the rand function, but not for the reason I thought.
you have to pin out from your rand function, meaning it run a different random number for those two. Store the output in a var, so you use the same number in your array and to substract from length.
I’ll try to do what u said))
Thank u much for your help, it’s works, I still a little confuse why is working by this way but i’ll get it by my own - thank u!!!
This is pretty much me most of the time…