From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 09:53:59 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0816B16A4CE for ; Fri, 21 Nov 2003 09:53:59 -0800 (PST) Received: from mgw-x1.nokia.com (mgw-x1.nokia.com [131.228.20.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F01143FA3 for ; Fri, 21 Nov 2003 09:53:56 -0800 (PST) (envelope-from Vijay.Singh@nokia.com) Received: from esvir05nok.ntc.nokia.com (esvir05nokt.ntc.nokia.com [172.21.143.37])hALHrsA27806 for ; Fri, 21 Nov 2003 19:53:54 +0200 (EET) Received: from daebh001.NOE.Nokia.com (unverified) by esvir05nok.ntc.nokia.com ; Fri, 21 Nov 2003 19:53:53 +0200 Received: from mvebe001.NOE.Nokia.com ([172.18.140.37]) by daebh001.NOE.Nokia.com with Microsoft SMTPSVC(5.0.2195.6747); Fri, 21 Nov 2003 09:53:51 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Nov 2003 09:53:50 -0800 Message-ID: <4D7B558499107545BB45044C63822DDE02C094C1@mvebe001.americas.nokia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: integer and long max/min values Thread-Index: AcOwCP5XbFH4bGSAQQCayauJ4ckLsgAT1YQg From: To: , X-OriginalArrivalTime: 21 Nov 2003 17:53:51.0071 (UTC) FILETIME=[6BEB76F0:01C3B058] cc: freebsd-hackers@freebsd.org Subject: RE: integer and long max/min values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 17:53:59 -0000 Write a simple C program to ++ an int or long variable and see when it = overflows. > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org > [mailto:owner-freebsd-hackers@freebsd.org]On Behalf Of ext=20 > Tim Kientzle > Sent: Friday, November 21, 2003 12:24 AM > To: Jay Sern Liew > Cc: freebsd-hackers@freebsd.org > Subject: Re: integer and long max/min values >=20 >=20 > Jay Sern Liew wrote: > > how do I find out the maximum (and minimum) value a long=20 > and int will hold > > in C? (before it overflows or underflows) >=20 > #include >=20 > INT_MAX and INT_MIN are the max/min values for an int > LONG_MAX and LONG_MIN are the max/min values for long. >=20 > Also, see stdint.h, which is defined in C99. >=20 > Also, buy a good C reference book. ;-) >=20 > Tim Kientzle >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to=20 > "freebsd-hackers-unsubscribe@freebsd.org" >=20