My code is based on the methods described here and here. def fraction?(number) number - number.truncate