home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / att / 2178 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.1 KB  |  39 lines

  1. Path: sparky!uunet!olivea!decwrl!sdd.hp.com!ux1.cso.uiuc.edu!news.cs.indiana.edu!babbage.ece.uc.edu!ucqais.cba.uc.edu!skilby
  2. From: skilby@ucqais.cba.uc.edu (Steven M. Kilby)
  3. Newsgroups: comp.sys.att
  4. Subject: float
  5. Message-ID: <1992Sep9.185432.15045@babbage.ece.uc.edu>
  6. Date: 9 Sep 92 18:55:06 GMT
  7. Sender: root@babbage.ece.uc.edu (Operator)
  8. Organization: University of Cincinnati, College of Business
  9. Lines: 26
  10. Originator: skilby@ucqais.cba.uc.edu
  11. Nntp-Posting-Host: ucqais.cba.uc.edu
  12.  
  13.  
  14. Could someone please clue me in to what I've screwed up below???
  15.  
  16. #include <stdio.h>
  17. #include <math.h>  
  18. float b,a ;
  19.  
  20. float proc (a,b)
  21. {
  22. if (b == 1.000000) {return a;} else {return 2.000000 * a;};}
  23.  
  24. main()
  25. {printf ("%f   %f\n" , proc(2.000000,1.000000), proc(2.000000,3.000000));
  26. }
  27.  
  28.  
  29. Why wouldn't this print 2.000000 and 4.000000?  I am running a 3B2 with
  30. Sys V R3.2 (its a 400 with MAU).  Please respond by email.
  31.  
  32.  
  33. Thanks,
  34.     Steve...
  35. -- 
  36. Steven M. Kilby..................Coordinator, Computer Information Systems
  37. University of Cincinnati................College of Business Administration
  38. (Steven.Kilby@UC.EDU or skilby@ucqais.cba.uc.edu)   PHONE:  (513) 556-7159
  39.