in reply to Re: grep integer and fractional part from a division (modulus ?)
in thread grep integer and fractional part from a division (modulus ?)

I think this is the best way to write it. You could assign the numbers to variables first (they likely are already), but the principle of your solution is clear.

One could write

($q, $r) = ( int( ($n=301) / ($d=60) ) , $n % $d );
but that is definitely less clear, even though it avoids the repetion of the numbers.
  • Comment on Re^2: grep integer and fractional part from a division (modulus ?)
  • Download Code