tags:

views:

327

answers:

3

From the question you can probably tell that I don't know much about code! My question is this:

What does this code mean?

mnlong <- 280.460 + .9856474 * time
mnlong <- mnlong %% 360
mnlong[mnlong < 0] <- mnlong[mnlong < 0] + 360

I understand that the mnlong and time are variables but the %% confuses me.

Could someone give me a basic description.

Thanks

+3  A: 

It's most likely that %% means integer division by modulo - the result is within 0..360 range. It's used for cases when some value can't get out of some reasonable range like longitute fo example that can be only within 0..360 degrees.

sharptooth
thanks very much
Pip
The range is 0..359 because 360 modulo 360 is 0.
Luc M
A: 

Taking an educated guess that the language here is either R or S/Splus. As others have said: %% is the mod operator.

dhn