Path: utzoo!attcan!uunet!tektronix!reed!barry From: barry@reed.UUCP (Barry Smith) Newsgroups: comp.sys.mac.programmer Subject: Re: Overflow Checking from within Pasca Keywords: Pascal Standard Message-ID: <10530@reed.UUCP> Date: 5 Oct 88 22:24:01 GMT References: <4276@polyslo.CalPoly.EDU> <900006@zaphod> <429@husc6.harvard.edu> Reply-To: barry@reed.UUCP (Barry Smith) Organization: Blue Sky Research, Portland OR Lines: 19 In article <429@husc6.harvard.edu> singer@endor.UUCP (Rich Siegel) writes: >... Pascal simply has no provisions for supporting >unsigned arithmetic, as C does. In any pascal, the only way to work >with unsigned values is to disable overflow and range checking. > > --Rich Pascal allows specification of "unsigned integers", although there is no specification of the mapping to the underlying hardware, of course. The declaration "var I: 0..65535" will declare an unsigned range of integers, ahd the declaration "type unsigned = 0..65535" specifies a new type that should, in a conforming implementation, range-check properly. There are several Pascal compilers that will perform the obvious mapping to the underlying hardware, although Lightspeed Pascal is apparently not one of these. (Nor is MPW Pascal, alas.) Barry Smith Blue Sky Research