This site requires JavaScript, please enable it in your browser!
Greenfoot back
CreatorMoon
CreatorMoon wrote ...

2021/4/10

What methods can a floating point/double be used in?

CreatorMoon CreatorMoon

2021/4/10

#
I'm just curious, what's even the point of doubles in Greenfoot if they can't be used?
danpost danpost

2021/4/10

#
CreatorMoon wrote...
I'm just curious, what's even the point of doubles in Greenfoot if they can't be used?
What makes you think they can't be used? (import the SmoothMover class and take a look at its code)
CreatorMoon CreatorMoon

2021/4/10

#
I just didn't notice any methods in the API that could support a floating point. I'm not sure how I didn't notice the SmoothMover class though, thanks! One more question though, are there any methods which accept a double as a valid parameter that can be used in the World or Actor classes?
danpost danpost

2021/4/10

#
CreatorMoon wrote...
are there any methods which accept a double as a valid parameter that can be used in the World or Actor classes?
No. All numeric parameters seem to be of int type.
CreatorMoon wrote...
what's even the point of doubles in Greenfoot
This is like asking "what is the point of furniture in a house if you don't use furniture to build the house." All the trigonometric, exponential and logarithmic methods in the java.lang.Math package use double values (for parameter and return types).
CreatorMoon CreatorMoon

2021/4/11

#
Ah. My bad.
You need to login to post a reply.