solar_longitude_after or modulo question

2003-10-24 Thread Daisuke Maki
Okay, I feel stupid asking this, but I have a question about a basic function, mod. My ported computations from CC become all wrong if I use Perl's built-in % operator. After a few trial and errors, it seemed like when CC mentions R = N mod M it's actually computing a fractional number. For

Re: solar_longitude_after or modulo question

2003-10-24 Thread Yitzchak Scott-Thoennes
On Thu, 23 Oct 2003, Daisuke Maki wrote: Okay, I feel stupid asking this, but I have a question about a basic function, mod. My ported computations from CC become all wrong if I use Perl's built-in % operator. After a few trial and errors, it seemed like when CC mentions R = N mod M

Re: solar_longitude_after or modulo question

2003-10-24 Thread Matt Sisk
Yitzchak Scott-Thoennes wrote: If you want to avoid use POSIX, floor is pretty easy: sub floor { int($_[0]) - ( int($_[0]) $_[0] ) } There's also lots of floor/ceil/round/nearest type functionality in Math::Round that might be of interest: