Undelivered mail

MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU
Sun Mar 13 20:57:21 AEST 1988


Subject:  Re: Constant overflow

[Non-Deliverable:  User does not exist or has never logged on]

Reply-To: Info-C at BRL.ARPA

Received: From UWAVM(MAILER) by ALASKA with Jnet id 0614
          for SXJVK at ALASKA; Sun, 13 Mar 88 01:38 AST
Received: by UWAVM (Mailer X1.25) id 6629; Sun, 13 Mar 88 02:38:29 PST
Date:         Sat, 12 Mar 88 23:52:23 GMT
Reply-To:     Info-C at BRL.ARPA
Sender:       Info-C List <INFO-C at NDSUVM1>
From:         Rafael Llave <llave at phoenix.Princeton.EDU>
Subject:      Re: Constant overflow
Comments: To: info-c at BRL-SMOKE.arpa
To:           Vic Kapella <SXJVK at ALASKA>

In article <2550059 at hpisod2.HP.COM>, decot at hpisod2.HP.COM (Dave Decot) writes:
 > Try this one on your favorite C compiler.  So far, every one I've tried
 > (including lint) has had no complaint:
 >
 >     long i = 9876543210L;
 >
 > (The problem, of course, is that that number doesn't fit in 32 bits...)

Integer arithmetic is not supposed to overflow and all
integers are  supposed to be taken ss defined modulo a power of 2 which
is implementation dependent. I have seen
some compilers that at compile time gave you warnings - God
bless them -- but to ensure portability of programs that
have to handle  occasionally large numbers , I have always
included some defensive lines.



More information about the Comp.lang.c mailing list