Object first,
Object second)
{
double iFirst;
if (!(first instanceof Number)) {
throw new InvalidArgumentException(
"Invalid parameter. "
+ "first parameter " + first
+ " of Mod function must be of type number");
} else {
iFirst = ((Number) first).doubleValue();
}
double iSecond;
if (!(second instanceof Number)) {
throw new InvalidArgumentException(
"Invalid parameter. "
+ "second parameter " + second
+ " of Mod function must be of type number");
} else {
iSecond = ((Number) second).doubleValue();