Further Examples: Condition (/;)
To illustrate Condition we define RealRoots which, if the discriminant disc is nonnegative, returns the roots of a quadratic polynomial with real coefficients a, b, c. However, if disc is negative the calculation of the roots is blocked.
Here disc is negative.
RealRoots returns unevaluated in this case.
Here RealRoots returns evaluated.
Here Condition is used to define a function depending on the sign of the argument.
Here Condition is used to restrict the argument of randomRelativelyPrime to be a prime greater than . Given a prime p, randomRelativelyPrime picks a random number between and p-1 that is relatively prime to p-1.