-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s_roundPackToF32.c rounding to odd #20
Comments
I think you're describing a different rounding mode. Round to odd always makes the result odd if the amount rounded off is nonzero. |
Hi Waterman, Thanks for your reply. u are right with rounding to odd. Another question is how to deal with overflow with rounding to odd. s_roundPackToF32.c, line 58 ~ 64, It seems roundIncrement take 0 in case of rod. IEEE754 defines the overflow value with other rounding mode, but without rod. How to know rod will take the largest finite value for overflow instead of infinite? Thanks, 86 uiZ = packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement; 58 if ( ! roundNearEven && (roundingMode != softfloat_round_near_maxMag) ) { IEEE754-2019, page 53: |
Hi,
s_roundPackToF32.c, line 96 implement rounding to odd as following:
96 if ( roundingMode == softfloat_round_odd ) {
97 sig |= 1;
Does this means rod always or the fraction part bit0 to 1'b1?
The correct behavior of rod suppose to be frac round up only:
Kou
The text was updated successfully, but these errors were encountered: