Re: Form k = i + j and test for overflow.
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Sun, 01 Jul 2007 05:21:21 -0800
Gary Scott wrote:
More so however, when the vendor first did something the "right" way and changed to do it the "wrong" way. For example, IBM once made a change in VS Fortran that meant you could no longer initialize integers with the max negative 32-bit integer value (-2147483648) commonly used to set a specific bit pattern for binary flag values. At first they refused to change it back claiming it was fully standard compliant, but after about 6 months of my first complaint (and an angry subsequent one), they released an update that put it back the "correct" way.
I would probably initialize with a hex constant, which hopefully
still worked. In C it is usual to use either the hex constant
or -2147483647-1, that is, a constant expression.
In expressions in both Fortran and C, constants are positive
and - is the unary negation operator. Initializers (for DATA
statements in Fortran 66) are specifically signed constants.
It would be usual, though likely not required, for signed
integer constant to include the most negative constant on
twos complement machines.
-- glen
.
- Follow-Ups:
- Re: Form k = i + j and test for overflow.
- From: robin
- Re: Form k = i + j and test for overflow.
- Prev by Date: data mining
- Next by Date: Re: Please help me understand my code
- Previous by thread: data mining
- Next by thread: Re: Form k = i + j and test for overflow.
- Index(es):
Relevant Pages
|