#4382 closed defect (notabug)
mousex mousey do integer math
Reported by: | tonyforster | Owned by: | walter |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Turtleart | Version: | Unspecified |
Severity: | Unspecified | Keywords: | |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | Unconfirmed |
Description
print python-function(y/x, mousex, mousey)
returns 0,1,2 etc
Attachments (2)
Change History (7)
Changed 10 years ago by tonyforster
comment:1 Changed 10 years ago by walter
- Resolution set to notabug
- Status changed from new to closed
comment:2 Changed 10 years ago by tonyforster
Ok
comment:3 Changed 10 years ago by walter
If you think it would be better to generate these points as float, I can do it. A bit on the fence.
comment:4 Changed 10 years ago by tonyforster
I presume the turtle division operator casts them as float. So the issue was my python skills. I suppose lots of other stuff is int too? Xpos? Screen width? Colour? Cast all python input as float?
comment:5 Changed 10 years ago by walter
Let's try it and see what breaks. I'll attach a patch.
Changed 10 years ago by walter
Note: See
TracTickets for help on using
tickets.
Not sure what the bug is here. mousex and mousey are ints, so in Python, you'll get an int when you divide. If you add flt(y)/x you get a fractional value. What are you expecting?