Class Round

  • All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable
    Direct Known Subclasses:
    BigDecRound, RInt

    public class Round
    extends NaryFunction
    A PostfixMathCommandI which rounds a number.
    round(a) adds 0.5 to the argument and returns the closest integer.
    round(a,3) rounds the argument to 3 decimal places.

    Note: This class was changed in version 3.4. Prior to 3.4, this class used the Math.rint method. In 3.4 and future releases Math.round will be used instead. The effect is changing the rounding behaviour when the input is equally close to two integers, Math.round rounds 1.5 down and Math.rint round it up.

    Author:
    Richard Morris
    See Also:
    RInt, Serialized Form
    • Constructor Detail

      • Round

        public Round()