Round Vs. Trunc
Curious how Round vs. Trunc work?
So far I see the same results, I was expecting Trunc to allow me specify the precision at which I wanted to drop....
I think this is a feature request, or possibly if someone can fill me in on an easy method to drop precision to the place.
-S
So far I see the same results, I was expecting Trunc to allow me specify the precision at which I wanted to drop....
I think this is a feature request, or possibly if someone can fill me in on an easy method to drop precision to the place.
-S
"Every act of creation is first an act of destruction." -Picasso
Remember that each module has its own wiki page..click on the ?, you'll find your answer... 
Thanks Nay, I guess I am looking more how to drop/truncate more precision in the decimal place for experimenting.
I havent dug to deep in experimenting with Round/Trunc.
Always appreciated!
-S
I havent dug to deep in experimenting with Round/Trunc.
Always appreciated!
-S
"Every act of creation is first an act of destruction." -Picasso
Okay I tested and saw the expected results using a constant.
Left me curious about constants though...I set constant to 12.85 and in the parameters it automatically sets = 12.8500003814697
This leaves me curious.
Left me curious about constants though...I set constant to 12.85 and in the parameters it automatically sets = 12.8500003814697
This leaves me curious.
"Every act of creation is first an act of destruction." -Picasso
-
Thomas Helzle
- Member
- Posts: 334
- Location: Berlin
- Contact:
Yeah, that is something rather irritating in Usine - float values change, even if very clear values are used that should normally be represented without precision problems like your example.
I don't know if there are internal processed doing something to the values that causes this.
Although it's more a cosmetic problem most of the time, it feels wrong
Cheers,
Tom
I don't know if there are internal processed doing something to the values that causes this.
Although it's more a cosmetic problem most of the time, it feels wrong
Cheers,
Tom
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
sephult wrote:Okay I tested and saw the expected results using a constant.
Left me curious about constants though...I set constant to 12.85 and in the parameters it automatically sets = 12.8500003814697
This leaves me curious.
it's because it's stored internally in a float variable.Thomas Helzle wrote:Yeah, that is something rather irritating in Usine - float values change, even if very clear values are used that should normally be represented without precision problems like your example.
in usine, for design and performance choice, all dataflow event are stored as float at some point in the engine.
it's hard to explain without deep math (search 'Single-precision floating-point' in google), but a float can represent exactly a number only if it's a power of 2.
anyway, it's an universal limitation in computer science and despite the fact it seem strange to have this king of vagueness, it work pretty well except in very specific case.
it's not an internal process but the way values are stored, maybe in other soft they do cosmetics or store values differently...Thomas Helzle wrote:I don't know if there are internal processed doing something to the values that causes this.
Although it's more a cosmetic problem most of the time, it feels wrong
but i can assure you that the cost to resolve this is hardly compatible with efficiency in a 'real time' point of view
Martin FLEURENT - Usine Developer - SDK maintainer
Thanks! I do understand differences in variable types....I just didn't realize that the constants were being stored as float.
I am guilty for not always going to the wiki, still getting used to that. I did however this time and saw....

Maybe we should update this to say it is stored as a Float value, and will display as such?
Thanks Thomas/Marignasse!
I am guilty for not always going to the wiki, still getting used to that. I did however this time and saw....
So I became very confusedConstant
Constant value.
out
Value of the constant
Maybe we should update this to say it is stored as a Float value, and will display as such?
Thanks Thomas/Marignasse!
"Every act of creation is first an act of destruction." -Picasso
Hello.
With this patch
You would choose between trunc or round and which decimal you want to keep (how many numbers after float).
With this patch
You would choose between trunc or round and which decimal you want to keep (how many numbers after float).
-
Thomas Helzle
- Member
- Posts: 334
- Location: Berlin
- Contact:
Yeah, as I said it's more a cosmetic issue.
And a reminder that what we nowadays think of as the ultimate in numeric precision is in fact the opposite:
Always slightly "wrong", even if negligible
Cheers,
Tom
And a reminder that what we nowadays think of as the ultimate in numeric precision is in fact the opposite:
Always slightly "wrong", even if negligible
Cheers,
Tom
Thanks for the patch share joffo ....much appreciated!
"Every act of creation is first an act of destruction." -Picasso
Who is online
Users browsing this forum: No registered users and 131 guests
