Class Conversion.Rat

  • Enclosing class:
    Conversion

    public static class Conversion.Rat
    extends Conversion
    Divides two Conversion instances via BigDecimal.divide(BigDecimal, MathContext).
    • Constructor Detail

      • Rat

        public Rat​(long num,
                   long denom)
    • Method Detail

      • convert

        public java.math.BigDecimal convert​(double original)
        Description copied from class: Conversion
        Primary operator for Conversion instances.
        Specified by:
        convert in class Conversion
        Parameters:
        original - A unit value which is to be processed through the tree-like representation of this equation. Only Conversion.Sym objects will actually use the "original" value.
        Returns:
        a BigDecimal result from the calculation. If this value maps to Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY, then a BigResult exception should be thrown before returning to clients.