I get an error when I try to calculate a mod with two doubles. There is no error when doing the equivalent calculation with a formula.
var a = 5 as Double; // or 5d
var b = 2 as Double; // or 2d
var c = a % b; // ERROR: Cannot perform operation 'mod...