normalize a location to within the valid range . given an arbitrary double not bound to 0.0 , 1.0 return the normalized double 0.0 , 1.0 which would result in simple wrapping/overflowing . e.g. normalize 0.3 +1.0 == 0.3 , normalize 0.3-1 .0 == 0.3 , normalize x == x with x in 0.0 , 1.0 concode_field_sep double LOCATION_INVALID concode_field_sep double getLocation concode_elem_sep double distanceAllowInvalid concode_elem_sep double distance concode_elem_sep double distance concode_elem_sep double change concode_elem_sep boolean equals concode_elem_sep boolean isValid concode_elem_sep double simpleDistance
double function ( double arg0 ) { double loc0 = arg0 % 1.0 ; if ( loc0 < 0 ) { return 1.0 + loc0 ; } return loc0 ; }