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,893 of 2,978   
   Marco van de Voort to Marco van de Voort   
   Re: longint and/or overflow bug?   
   31 Oct 12 10:11:49   
   
   From: marcov@toad.stack.nl   
      
   On 2012-10-31, Marco van de Voort  wrote:   
   > On 2012-10-30, Jim Leonard  wrote:   
   >>   
   >> var   
   >>   l:longint;   
   >>   w1,w2:word;   
   >>   
   >> begin   
   >>   w1:=val1; w2:=val2;   
   >>   l:=w1 * w2; {Throws runtime 215 "arithmetic overflow" if $Q+}   
   >   
   > typing:   
   > longint :=word * word   
      
   > Pascal rule is afaik that an expression is evaluated in (at least?) the   
   > combined range of the operands.  Which is word.   
      
   Hmm, thinking of it, in Pascal the above is impossible, since range(word)   
   is not a subset of range(integer). Those are special yet again.   
      
   Still the behaviour is normal and consistent in the Borland lines and   
   compatibles.   
      
   --- 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