AngleGadget - circular trackbar + user-defined labels
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: AngleGadget - circular trackbar + user-defined labels
@skywalk: That has nothing to do with the float assignment. You're testing the (continually incrementing) count var against itself multiplied by 2. It should go on forever, if it didn't that would be a concern.
BERESHEIT
Re: AngleGadget - circular trackbar + user-defined labels
@netmaestro
OMG. I just checked the 4.20 (one of the first versions I used).
You are right, the decimal part was cut off at the time ! This can be a major cause of old sources going to hell.
It's not like a library command modified, it's the core of the language.
I don't feel very well ....
output of PB 4.20 for reference:
When all this changed ? And most importantly, can we count to have this behavior back again ?
OMG. I just checked the 4.20 (one of the first versions I used).
You are right, the decimal part was cut off at the time ! This can be a major cause of old sources going to hell.
It's not like a library command modified, it's the core of the language.
I don't feel very well ....
output of PB 4.20 for reference:
Code: Select all
l.i = 0.6 * 2
Debug l ; 1 (1.2 rounded down, apparently) - in reality cut off
l.i = 0.9 * 2
Debug l ; 1 (cut off)
l.i = 0.6
Debug l*2 ; 0 (make sense)
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: AngleGadget - circular trackbar + user-defined labels
Fred should change it back, that's my opinion.
c:
c:
Code: Select all
#include <stdio.h>
int main()
{
float a = 0.99;
int b = 0;
b=a;
printf( "Float 0.9 assigned to int 0 = %d", b ); /* displays 0, the whole decimal portion is chopped */
getchar();
}
Last edited by netmaestro on Mon Jul 11, 2011 4:29 pm, edited 1 time in total.
BERESHEIT
Re: AngleGadget - circular trackbar + user-defined labels
Are you asking that it be changed back?luis wrote: snip
When all this changed ? And most importantly, can we count to have this behavior back again ?
If so, anyone counting on the more recent behavior would be in trouble.
cheers
Re: AngleGadget - circular trackbar + user-defined labels
Exactly so.rsts wrote: If so, anyone counting on the more recent behavior would be in trouble.
And I reiterate that ALL this should be written down, it's really silly to have to experiment to see when a implicit cast is performed and how (round up, round down, cut off, etc.). Same thing for what's happening inside a mixed expression, and moreover on different architectures (x86/x64) if there are differences (and the code in this thread just shown there are plenty).
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: AngleGadget - circular trackbar + user-defined labels
I can find no mention of this in the history page. That is a concern as it seems completely undocumented.
BERESHEIT
Re: AngleGadget - circular trackbar + user-defined labels
What I mean is, instead of adding a new 3d command it's a lot more important to define and document the basic behavior of the language to help the initial understanding from new users and avoid further "drifting" like this in the future for old ones.
For example, I'm certainly dumb, and I didn't notice this was changed. I simply thought, "oh look, pb does it that way? I thought was the same way of C, well ok". Instead netmaestro remembered something different (thanks to him!).
If all this was clearly defined I would have checked the language definition like I would do for C, C++ or whatever.
OK a little experiment and hacking, Fred & Co are not an armada of software developers, with a branch dedicated to documentation and so on, they are great and I respect them, but some perspective on what it's really important is required.
At least that's my very personal opinion. Hope this can be taken as benign criticism.
EDIT in 2020: Wow, reading this today I find incredible how naive I was just 9 years ago.
For example, I'm certainly dumb, and I didn't notice this was changed. I simply thought, "oh look, pb does it that way? I thought was the same way of C, well ok". Instead netmaestro remembered something different (thanks to him!).
If all this was clearly defined I would have checked the language definition like I would do for C, C++ or whatever.
OK a little experiment and hacking, Fred & Co are not an armada of software developers, with a branch dedicated to documentation and so on, they are great and I respect them, but some perspective on what it's really important is required.
At least that's my very personal opinion. Hope this can be taken as benign criticism.
EDIT in 2020: Wow, reading this today I find incredible how naive I was just 9 years ago.
Last edited by luis on Fri Aug 14, 2020 8:08 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: AngleGadget - circular trackbar + user-defined labels
brain fart.netmaestro wrote:@skywalk: That has nothing to do with the float assignment. You're testing the (continually incrementing) count var against itself multiplied by 2. It should go on forever, if it didn't that would be a concern.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: AngleGadget - circular trackbar + user-defined labels
despite the casting bugs , that's a one nice control thanks Stargate
Windows 11, Manjaro, Raspberry Pi OS
-
- User
- Posts: 40
- Joined: Wed Oct 06, 2010 9:37 pm
Re: AngleGadget - circular trackbar + user-defined labels
Is working fine if replacing the deprecated #PB_Canvas_GrabMouse with #PB_Canvas_Cursor. Thanks!
Newbie
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: AngleGadget - circular trackbar + user-defined labels
Apparently, i not see this code in 2011
So a "little bit" thanks at Stargate for sharing it
So a "little bit" thanks at Stargate for sharing it
The happiness is a road...
Not a destination
Not a destination