posted 20 years ago
Kassi, Thomas is correct in that you only need to perform a cast to convert the number. He also points out the downside to the "narrowing conversion".
If you are concerned that the number is converted correctly, you can check that the long value is not greater than Integer.MAX_VALUE before attempting the cast, or you can verify that i == lg after the conversion.
Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>