Dbl_copyfromptr(srcptr,srcp1,srcp2); /* *checksourceoperandforNaNorinfinity
*/ if ((src_exponent = Dbl_exponent(srcp1)) == DBL_INFINITY_EXPONENT) { /* *issignalingNaN?
*/ if (Dbl_isone_signaling(srcp1)) { /* trap if INVALIDTRAP enabled */ if (Is_invalidtrap_enabled()) return(INVALIDEXCEPTION); /* make NaN quiet */
Set_invalidflag();
Dbl_set_quiet(srcp1);
} /* *ReturnquietNaNorpositiveinfinity. *Fallthroughtonegativetestifnegativeinfinity.
*/ if (Dbl_iszero_sign(srcp1) ||
Dbl_isnotzero_mantissa(srcp1,srcp2)) {
Dbl_copytoptr(srcp1,srcp2,dstptr); return(NOEXCEPTION);
}
}
/* *checkforzerosourceoperand
*/ if (Dbl_iszero_exponentmantissa(srcp1,srcp2)) {
Dbl_copytoptr(srcp1,srcp2,dstptr); return(NOEXCEPTION);
}
/* *checkfornegativesourceoperand
*/ if (Dbl_isone_sign(srcp1)) { /* trap if INVALIDTRAP enabled */ if (Is_invalidtrap_enabled()) return(INVALIDEXCEPTION); /* make NaN quiet */
Set_invalidflag();
Dbl_makequietnan(srcp1,srcp2);
Dbl_copytoptr(srcp1,srcp2,dstptr); return(NOEXCEPTION);
}
/* check for inexact */ if (Dbl_isnotzero(srcp1,srcp2)) { if (!even_exponent && Dbl_islessthan(resultp1,resultp2,srcp1,srcp2)) {
Dbl_increment(resultp1,resultp2);
}
guardbit = Dbl_lowmantissap2(resultp2);
Dbl_rightshiftby1(resultp1,resultp2);
/* now round result */ switch (Rounding_mode()) { case ROUNDPLUS:
Dbl_increment(resultp1,resultp2); break; case ROUNDNEAREST: /* stickybit is always true, so guardbit
* is enough to determine rounding */ if (guardbit) {
Dbl_increment(resultp1,resultp2);
} break;
} /* increment result exponent by 1 if mantissa overflowed */ if (Dbl_isone_hiddenoverflow(resultp1)) src_exponent+=2;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.