/*ident "@(#)cls4:lib/task/task/sim.c 1.3" */ /******************************************************************************* C++ source for the C++ Language System, Release 3.0. This product is a new release of the original cfront developed in the computer science research center of AT&T Bell Laboratories. Copyright (c) 1993 UNIX System Laboratories, Inc. Copyright (c) 1991, 1992 AT&T and UNIX System Laboratories, Inc. Copyright (c) 1984, 1989, 1990 AT&T. All Rights Reserved. THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of AT&T and UNIX System Laboratories, Inc. The copyright notice above does not evidence any actual or intended publication of such source code. *******************************************************************************/ #include #include "hw_stack.h" /* Needed for MAXINT_AS_FLOAT */ histogram::histogram(int nb, int ll, int rr) { register int i; if (rr<=ll || nb<1) object::task_error(E_HISTO, (object*)0); if (nb%2) nb++; while ((rr-ll)%nb) rr++; binsize = (rr-ll)/nb; h = new int[nb]; while (h == 0) object::task_error(E_STORE, (object*)0); for (i=0; i= 0) h[i--] = 0; binsize += binsize; } while (r<=a) { r += r - l; for (i=0, j=0; i