Annotation of researchv10no/cmd/cfront/libC/task/erand.c, revision 1.1.1.1

1.1       root        1: /*ident        "%W%" */
                      2: /**************************************************************************
                      3:                        Copyright (c) 1984 AT&T
                      4:                          All Rights Reserved   
                      5: 
                      6:        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
                      7:        
                      8:        The copyright notice above does not evidence any        
                      9:        actual or intended publication of such source code.
                     10: 
                     11: *****************************************************************************/
                     12: #include <task.h>
                     13: #include <math.h>
                     14: #include "hw_stack.h"
                     15: 
                     16: /* NOTE:  This function is in a separate file because it needs the
                     17:  * math library. Programs that bring in this file must link with -lm
                     18:  */
                     19: int
                     20: erand::draw()
                     21: {
                     22:        return (int)(-mean * log( (double)(MAXINT_AS_FLOAT-randint::draw())
                     23:                                / MAXINT_AS_FLOAT) + .5);
                     24: }
                     25: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.