public static FixedPoint Floor(FixedPoint value) { FixedPoint fraction = value.Fraction(); if (fraction != 0) { return(value - value.Fraction() - (FixedPoint)(value > 0 ? 0 : 1)); } return(value); }
public static FixedPoint Ceiling(FixedPoint value) { FixedPoint fraction = value.Fraction(); if (fraction != 0) { return(value - value.Fraction() + (FixedPoint)(value > 0 ? 1 : 0)); } return(value); }