delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/01/18:50:24

From: Mark Levis <mlevis AT voyager DOT net>
Newsgroups: comp.lang.c,comp.os.msdos.djgpp
Subject: Re: having trouble with long numbers
Date: Wed, 30 Jul 1997 17:52:25 -0400
Organization: Voyager Information Networks, Inc.
Lines: 36
Message-ID: <33DFB799.BF87F767@voyager.net>
References: <01bc9c51$0ceeec80$78ed1fcc AT darkstar> <33DE6FA3 DOT 460B59E AT voyager DOT net> <5rmp03$58l$1 AT news DOT belwue DOT de>
NNTP-Posting-Host: 207.74.97.75
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jens Schweikhardt wrote:

> # An int will only handle number from -32767 to 32768.
>
> Nope. An int will handle at least any number from -32767 to 32767. It
> might be able to hold 32, 42 or 64 bit.  (Note that on many 16bit 2s
> complement machines your sign needs to be reversed:  INT_MIN from
> <limits.h> may be -32768 and INT_MAX may be 32767).
>

Correct what I should have said is short. The probvlem still remains
that the values that are being looked
for will require a double too be used.

>  unsigned int 0 65535
>
>

Same here unsinged short. I guess I have been working away from UNIX for
too long.
Even the test I give applicants requirews the knowledge of int's being
different sizes depending on compiler /  O/S.


> Dito. These are minimum values only. See UINT_MAX from <limits.h>.
>
> Regards,
>
>         Jens
> --
> Jens Schweikhardt
> http://www.uni-stuttgart.de/People/schweikhardt/home.html
> SIGSIG -- signature too long (core dumped)



- Raw text -


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