in reply to Re^4: Best way to make sure a number is an even multiple of another?
in thread Best way to make sure a number is an even multiple of another?

7 is not an even number (i.e. - not divisible by 2)
  • Comment on Re^5: Best way to make sure a number is an even multiple of another?

Replies are listed 'Best First'.
Re^6: Best way to make sure a number is an even multiple of another?
by thor (Priest) on Oct 21, 2004 at 14:32 UTC
    In this case, there's an overload on the word "even". You're using it in the "divisible by two" sense, whereas in this context it means "an number m divides an integer n evenly if and only if there exists an integer k such that m * k = n". Stated another way, n % m == 0.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

Re^6: Best way to make sure a number is an even multiple of another?
by grinder (Bishop) on Oct 21, 2004 at 14:33 UTC

    Looking at the table of data provided by demerphq, I suspect you should parse 'even' as 'exact'.

    - another intruder with the mooring of the heat of the Perl

Re^6: Best way to make sure a number is an even multiple of another?
by husker (Chaplain) on Oct 21, 2004 at 14:33 UTC
    By "even multiple" I think he means "integer multiple". Looking at the table he provides, he does get "odd" results ($n = 7, $m = 3, fix ($n,$m) = 3).