Renesas Technology, Tools FAQs
Last Updated: March 21, 2000
Document Number: 01051275_e
Q.
How are the following operations are handled in NC30?
Rounding direction of negative integer division "/" result.1.
Sign of negative integer remainder "%" result.2.
Does negative integer right-shift ">>" result make arithmetic shift (sign bit stuffing in MSB) or logical shift (0 stuffed in
MSB)?
3.
A.
The operation results of negative integer division "/" is rounded toward 0 (zero).
Equation Results
(-10) / 3
(-10) % 3
10 / ( -3)
10 % ( -3)
(-10) / (-3)
(-10) % (-3)
-3
-1
-3
1
3
-1
1.
The sign of negative integer remainder "%" operation result is set equal to the dividend sign.
Equation Results
(-10) % 3
10 % ( -3)
(-10) % (-3)
-1
1
-1
(NOTE) If you specify the option -fround_under_div(-fRUD), it is set equal to the divisor sign.
2.
Negative integer right-shift ">>" is treated as an arithmetic shift. Therefore, MSB is stuffed with sign bits.3.
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Comentarios a estos manuales