Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
Float Expression Bug
Moderator: Support
Float Expression Bug
Hi team
I encountered a bug with the float expression node. please see attached screenshot.
If I use numbers (1920/1080) instead of the variables (A/B) in the expression : I get integer instead of float in the result output.
Best Regards.
I encountered a bug with the float expression node. please see attached screenshot.
If I use numbers (1920/1080) instead of the variables (A/B) in the expression : I get integer instead of float in the result output.
Best Regards.
Re: Float Expression Bug
Hi,
that's not a bug. If you're writing
you're using integer - the result will then be cast to float - after it's already truncated. If you're using the parameter fields - they are defined as float, so they are implicitly cast to float. You could do:
to use floats or
to use doubles (the result will be cast to float).
cheers,
rou
that's not a bug. If you're writing
Code: Select all
1920 / 1080
Code: Select all
1920.0f / 1080.0f
Code: Select all
1920.0 / 1080.0
cheers,
rou
Re: Float Expression Bug
Ok, I was unaware of that.
Thanks
Thanks
-
- Posts: 666
- Joined: 18 Jan 2012, 20:56
- Location: wuppertal
- Contact:
Re: Float Expression Bug
But what is not realy consequent is, that 10/A is possible
Greetings
Christian
Greetings
Christian
Re: Float Expression Bug
That is because input property A is explicitly defined as float.chriss0212 wrote:But what is not realy consequent is, that 10/A is possible
Re: Float Expression Bug
It is super consistent - IF you know that the input field is basically interpreted as C# code. And in C# the casting behaves as it does in most languages
Re: Float Expression Bug
sorry christian i am with rou in this point
-
- Posts: 666
- Joined: 18 Jan 2012, 20:56
- Location: wuppertal
- Contact:
Re: Float Expression Bug
Hi...
i haven't said, that it is not consistent! It's just not easy to understand for a beginner that A/B is ok even if A and B is an int, but A/10 is not allowed
I am really happy that Ventuz is doing all the conversions by using nodes... but i think a lot beginners (and sometimes me too) would be happy, if an int used in a expression would be converted too
For the moment i can't see any disadvantage because in both cases the expression node is dealing with 2 integer's. But maybe there is?
Greetings
Christian
i haven't said, that it is not consistent! It's just not easy to understand for a beginner that A/B is ok even if A and B is an int, but A/10 is not allowed
I am really happy that Ventuz is doing all the conversions by using nodes... but i think a lot beginners (and sometimes me too) would be happy, if an int used in a expression would be converted too
For the moment i can't see any disadvantage because in both cases the expression node is dealing with 2 integer's. But maybe there is?
Greetings
Christian
Re: Float Expression Bug
I get your point, I do. Two reasons to keep it this way:
1. it's like in coding languages, so every coder knows. I'm a coder, so I'm biased I know that beginners find it more difficult. BUT: You should always use the inputs - that's just cleaner than typing in 1920/1080
2. To achieve your behaviour, Ventuz would have to write their own parser/compiler. Currently they most likely don't and just use C# - which is the better solution (far safer in terms of errors and standard behaviour).
But again, I get where you're coming from.
cheers,
rou
1. it's like in coding languages, so every coder knows. I'm a coder, so I'm biased I know that beginners find it more difficult. BUT: You should always use the inputs - that's just cleaner than typing in 1920/1080
2. To achieve your behaviour, Ventuz would have to write their own parser/compiler. Currently they most likely don't and just use C# - which is the better solution (far safer in terms of errors and standard behaviour).
But again, I get where you're coming from.
cheers,
rou
Re: Float Expression Bug
Rou is right!
And he listed the arguments why we won't change this behaviour.
Cheers
Karol
And he listed the arguments why we won't change this behaviour.
Cheers
Karol