Semipredicate Problem - Example

Example

The division operation yields a real number, but fails when the denominator is zero. If we were to write a function that performs division, we might choose to return 0 on this invalid input. However, if the numerator is 0, the result is 0 too. Also, even if a nonzero numerator is required, dividing a small number by a very large one can yield 0 as well, due to rounding errors. This means there is no number we can return to uniquely signal attempted division by zero, since all real numbers are in the range of division.

Read more about this topic:  Semipredicate Problem

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)