11.001001000011111101101010100010001000 Arithmazium
Home

Cases 3 and 2

Case 3 falls through without comment to a final test. Its nonzero underflow_threshold indicates that it underflows to nonzero values, but the arithmetic is unable to represent the differences, so add_sub_hi is zero.

Case 2 is anomalous, as the messages indicate, because very tiny values compare equal yet don’t subtract to zero. Value underflow_threshold is set to a tiny value known to behave well and below which the arithmetic misbehaves.

else:
    # BASIC cases 1-3. Case 3 falls through to a final test.
    if underflow_threshold == ZERO:  # Cases 1-2
        if add_sub_tiny:
            # Case 2
            underflow_threshold = add_sub_hi  # last good behavior
            bad_cond(err_failure,
                     "Underflow confuses Comparison, which alleges that")
            print("add_sub_hi == add_sub_lo while denying that |add_sub_hi"
                  + " - add_sub_lo| == 0; these values")
            print("print out as add_sub_hi = {:0.17e}, "
                  + "add_sub_lo ={:0.17e} .".format(add_sub_hi, add_sub_lo))
            print("|add_sub_hi - add_sub_lo| = {:0.17e} ."
                  .format(fabs(add_sub_hi - add_sub_lo)))
            # BUG: C lacks the following message.
            print("and add_sub_hi / add_sub_lo| = 1.0 + {:0.17e} ."
                  .format((add_sub_hi / add_sub_lo - ONE_HALF) - ONE_HALF))
Home