delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/10/02:46:34

From: dfremlin AT facstaff DOT wisc DOT edu (John Fremlin)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: long long int assignments
Date: 10 May 1997 05:23:47 GMT
Organization: University of Wisconsin, Madison
Lines: 24
Message-ID: <5l10p3$541u@news.doit.wisc.edu>
References: <Pine DOT 3 DOT 89 DOT 9705081555 DOT A32279-0100000 AT alpha DOT hcst DOT com>
NNTP-Posting-Host: f181-100.net.wisc.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <Pine DOT 3 DOT 89 DOT 9705081555 DOT A32279-0100000 AT alpha DOT hcst DOT com>,
Bryan Murphy <bryan AT hcst DOT com> posted:
>I have a sequence of assighments that follows like this:
>
>unsigned long long int millimeters = (unsigned long long int)-1;

[snip]

>Anyways, if I don't type cast centinal values when assigning them to
>long long int types, I get a warning telling me the value is out of
>range, yet the long long int receives the value fine.  Any reason why
>this happens and what can I do to stop the warnings short of typecasting
>every big assignment?

Append a "ull" (Unsigned Long Long) to each of your numbers i.e.:
        JohnsBirthdayRepeated = 198211101982111019821110ull;

[snip]

-- 
John Fremlin (dfremlin AT facstaff DOT wisc DOT edu)
             (fremdh AT essex DOT ac DOT uk)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019