method
round

round()
public
Hide source
static VALUE nurat_round(VALUE self) { get_dat1(self); if (f_negative_p(dat->num)) { VALUE num, den; num = f_negate(dat->num); num = f_add(f_mul(num, TWO), dat->den); den = f_mul(dat->den, TWO); return f_negate(f_idiv(num, den)); } else { VALUE num = f_add(f_mul(dat->num, TWO), dat->den); VALUE den = f_mul(dat->den, TWO); return f_idiv(num, den); } }