im getting the same effect when using greater, greater or equal, lower, lower or equal
-3 is less than -1 though.
I got into the habit of casting everything to a float before i do any sums cos of the way it affects division in most languages - I find it's generally good practice
Why this was still eating at me is a mystery but I went on a journey through the bowels of stack overflow it emerges that this is entirely possible in C if you don't implement the comparision function in a way that accounts for the negative number (it defaults to doing the comparison in unsigned space if one of the two numbers isn't signed - or something like that).
still a bug, but it's nice to know where it comes from
Here is another weird thing of similar nature probably. If you turn negative integer to float you get something weird but when you try to do it with two integers it's just fine.
The large number makes sense assuming it's behaving like C cos when you simply remove the sign bit from a signed negative int you get a large positive number.
Integer2 isn't a conventional data type so I suspect that actually uses floats internally
Replies
They should. That smells like a bug.
Thanks poopipe . I thought I am crazy or missed something big in school.
I decided to test it
im getting the same effect when using greater, greater or equal, lower, lower or equal
-3 is less than -1 though.
I got into the habit of casting everything to a float before i do any sums cos of the way it affects division in most languages - I find it's generally good practice
Yeah, you are right poopipe. I figured out I could just set 1 in input step slider instead of 0.01 and it would be perfectly integer like working.
Why this was still eating at me is a mystery but I went on a journey through the bowels of stack overflow it emerges that this is entirely possible in C if you don't implement the comparision function in a way that accounts for the negative number (it defaults to doing the comparison in unsigned space if one of the two numbers isn't signed - or something like that).
still a bug, but it's nice to know where it comes from
Here is another weird thing of similar nature probably. If you turn negative integer to float you get something weird but when you try to do it with two integers it's just fine.
The large number makes sense assuming it's behaving like C cos when you simply remove the sign bit from a signed negative int you get a large positive number.
Integer2 isn't a conventional data type so I suspect that actually uses floats internally