Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/11/04 20:12
Read: times


 
#72396 - RE: Fractional Equivalence
Responding to: ???'s previous message
Tom said:

You just need to do your homework when bounds checking and selecting variable size so that they don't overflow when doing the multiply.


That's what I said, but perhaps not as clearly, and it certainly bears repeating. You can get the strangest results and some real subtle problems if your data ranges beyond your expectations and you get an overflow somewhere in your calculations.

Extra caution is required if you have the need to mix signed and unsigned numbers. You will be better off if you cast a variable yourself, rather than letting the compiler handle integer promotion and sign extending in the sequence it chooses (which might not convert a number the way you would expect).

Dennis

List of 13 messages in thread
TopicAuthorDate
Fractional Equivalence            01/01/70 00:00      
   RE: Fractional Equivalence            01/01/70 00:00      
      RE: Fractional Equivalence            01/01/70 00:00      
         RE: Fractional Equivalence            01/01/70 00:00      
      RE: Fractional Equivalence            01/01/70 00:00      
         RE: Fractional Equivalence            01/01/70 00:00      
   RE: Fractional Equivalence            01/01/70 00:00      
      RE: Fractional Equivalence            01/01/70 00:00      
         RE: Fractional Equivalence            01/01/70 00:00      
            RE: Fractional Equivalence            01/01/70 00:00      
            RE: Fractional Equivalence            01/01/70 00:00      
               RE: Fractional Equivalence            01/01/70 00:00      
   RE: Fractional Equivalence            01/01/70 00:00      

Back to Subject List