home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,894 of 2,978   
   =?UTF-8?Q?Vinzent_H=C3=B6fler?= to Jim Leonard   
   Re: longint and/or overflow bug?   
   30 Oct 12 18:18:21   
   
   e1050251   
   From: 0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de   
      
   Jim Leonard  wrote:   
   >   l:=w1 * w2; {Throws runtime 215 "arithmetic overflow" if $Q+}   
      
   Yes. The value is calculated in word-range, so it does actually   
   overflow. The type of the result variable does not matter at this   
   point.   
      
   You must tell the compiler to calculate this as longint. I'm not sure   
   if casting the whole expression to longint will suffice (probably   
   not), but casting at least one operand should tell the compiler to   
   use 32-bit arithmetic here.   
   Keep in mind that TP is a 16-bit compiler, it doesn't use 32-bit   
   arithmetic by default.   
      
      
   Vinzent.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca