Added primitive type compatibility. <flonum> <-> double.
bug fix. could not compare the type, return Int32::MaxValue.
Changed the algorithm to create a generic method.