Class FieldSqrt

  • All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable

    public class FieldSqrt
    extends UnaryFunction
    Calculate the square root of a number using any field. Uses the Babylonian method with the iterative formula x_{n+1} = (x_n + S / x_n) / 2 where S is the input number scaled to lie between 1/16 and 16. Algorithm will stop until convergence or the maximum number of iterations is reached.
    See Also:
    Serialized Form
    • Constructor Detail

      • FieldSqrt

        public FieldSqrt​(FieldI f,
                         int num_itts)
        Constructor
        Parameters:
        f - the field for all computations
        num_itts - maximum number of iterations