Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpcea!hpcilzb!cnc From: cnc@hpcilzb.HP.COM (Chris Christensen) Newsgroups: comp.sys.mac Subject: Lightspeed C bug? Message-ID: <870081@hpcilzb.HP.COM> Date: 22 Dec 87 17:12:36 GMT Organization: HP Design Tech Center - Santa Clara, CA Lines: 27 I have been having a real head-scratcher problem with Lightspeed C. I am trying to generate random numbers from 0 to 7. I use #define ABS(x) (((x) < 0) ? -(x) : (x)) x = ABS(Random()) % 8; I get random numbers from -7 to 7 I use x = Random(); x = ABS(x); x %= 8; I get the desired range. This is the define for Absolut that I have always used. Why doesn't this work? Am I being bitten by a "one pass" compiler bug? -------------------------------------------------------------------------------- Chris Christensen Hewlett-Packard (408) 553-2955 or telnet 553-2955 Design Technology Center cnc%hpdtc@hplabs.hp.com Santa Clara, CA ...!hplabs!hpcid!cnc