www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/21/17:58:07

Xref: news-dnh.mv.net comp.os.msdos.djgpp:493
Path: news-dnh.mv.net!mv!news.sprintlink.net!simtel!harbinger.cc.monash.edu.au!mdw023.cc.monash.edu.au!rtedw1
From: rtedw1 AT mdw023 DOT cc DOT monash DOT edu DOT au (Russell Edwards)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: MAXINT?
Date: 20 Jun 1995 14:17:27 GMT
Organization: Monash University
Lines: 26
References: <3s4du6$mu3 AT oravannahka DOT Helsinki DOT FI>
Nntp-Posting-Host: mdw023.cc.monash.edu.au
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Carl DOT Johansson AT Helsinki DOT fi (Carl Johansson) writes:

>Does anyone know what the MAXINT statement in the explanation of the
>random() function is? Is it a variable, some kind of function
>parameter or something else, and how do you use it? (My version is
>1.12).

 MAXINT is defined in values.h and is the maximum value you can
store in a variable of type integer. Your implementation of random()
probably returns a random number between 0 and MAXINT, this is so as
to allow the maximum resolution possible. Simply scale it to what
you want, eg divide it by (MAXINT/10) to get a number between 0 an 10.

  I don't know about dgpp but most DOS compilers have MAXINT = 0x7fff
= 32767. Maybe because of the dpmi stuff you get a nice 32 bits so
MAXINT will be 2^31 appox = 2.147 billion. Anyway, it doesn't really
matter since you should just use MAXINT for portability.

HTH a little bit but I apologize for the hazy nature of the reply :)

Russell 
-- 
    Russell Edwards  --  voodoo AT yoyo DOT cc DOT monash DOT edu DOT au  --  IRC: VoodChile
 Student of Computer Science and Electrical and Computer Systems Engineering
 -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-
                         Woohoo!! I mean 'DOH!'

- Raw text -


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