question: public static double dmod_d ( double lhs , double rhs ) { return rhs != 0 ? lhs - rhs * Math . floor ( lhs / rhs ) : Double . NaN ; }
target:  Take modulo for double numbers according to lua math, and return a double result.