Datasheet
ARM Compiler Reference
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-25
• Any quantity that specifies the amount of a shift is treated as an unsigned 8-bit
value.
• Any value to be shifted is treated as a 32-bit value.
• Left shifts of more than 31 give a result of zero.
• Right shifts of more than 31 give a result of zero from a shift of an unsigned value
or positive signed value. They yield –1 from a shift of a negative signed value.
• The remainder on integer division has the same sign as the divisor.
• If a value of integral type is truncated to a shorter signed integral type, the result
is obtained by discarding an appropriate number of most significant bits. If the
original number was too large, positive or negative, for the new type, there is no
guarantee that the sign of the result will be the same as the original.
• A conversion between integral types does not raise an exception.
• Integer overflow does not raise an exception.
• Integer division by zero raises a SIGFPE exception.
Operations on floating-point types
The following statements apply to operations on floating-point types:
• normal IEEE 754 rules apply
• rounding is to the nearest representable value by default
• floating-point exceptions are disabled by default.
Note
The IEEE 754 standard for floating-point processing states that the default action to an
exception is to proceed without a trap. You can modify floating-point error handling by
tailoring the functions and definitions in
fenv.h
. See Tailoring error signaling, error
handling, and program exit on page 4-51 and the chapter on floating-point in the ADS
Developer Guide.
Pointer subtraction
The following statements apply to all pointers in C. They also apply to pointers, other
than pointers to members, in C++:
• When one pointer is subtracted from another, the difference is obtained as if by
the expression:
((int)a - (int)b) / (int)sizeof(type pointed to)