drfinlayscott/mizer — pull request #2 by gustavdelius (2014-02-01 22:09:48+00:00)
Title: Mizer does not work on all machines.

I was quite surprised when mizer was not working on my home PC even though it worked so nicely in the office. I have the same version of R 3.0.2 on both machines, so I was a bit puzzled. It turns out that the %% operator is machine dependent when used with non-integer divisor. On my PC for example 50 %% 0.1 evaluates to 0.1, not to 0 as expected. This has the consequence that the checks that t_max and t_save are divisible by dt sometimes fail unexpectedly.

This machine dependence of the result of %% is actually documented in the R help. It says there:
"%% and x %/% y can be used for non-integer y, e.g. 1 %/% 0.2, but the results are subject to representation error and so may be platform-dependent. Because the IEC 60059 representation of 0.2 is a binary fraction slightly larger than 0.2, the answer to 1 %/% 0.2 should be 4 but most platforms give 5."

I do not know how to check divisibility in such a way that it is not machine dependent, so I just commented out the checks. The rest of the code seems to work fine.