Paul L. wrote:

These two lines can be replaced with:

degrees %= 360

And the resulting method will run much faster if the degrees argument is

large.

Got it. Thanks. ( the result of a % b will be >= 0 if b > 0 … )

Paul L. wrote:

These two lines can be replaced with:

degrees %= 360

And the resulting method will run much faster if the degrees argument is

large.

Got it. Thanks. ( the result of a % b will be >= 0 if b > 0 … )

David T. wrote:

Paul L. wrote:

These two lines can be replaced with:

degrees %= 360

And the resulting method will run much faster if the degrees argument is

large.Got it. Thanks. ( the result of a % b will be >= 0 if b > 0 … )

The result will also be >= 0 if a < 0. I am adding this clarification

for

other readers of the newsgroup, I am sure you understand it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs