home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3328 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.0 KB  |  61 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!statoil!fou.tr.statoil.no!bhso
  3. From: bhso@fou.tr.statoil.no (Bjorn Halvor Solberg)
  4. Subject: Re: Small Language Wanted
  5. Message-ID: <1992Sep1.113610.2351@statoil.no>
  6. Sender: usenet@statoil.no
  7. Nntp-Posting-Host: und21.fou.tr.statoil.no
  8. Reply-To: bhso@fou.tr.statoil.no
  9. Organization: Statoil R&D, Trondheim
  10. References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu> <DAVIS.92Aug27211418@pacific.mps.ohio-state.edu>
  11. Date: Tue, 1 Sep 1992 11:36:10 GMT
  12. Lines: 47
  13.  
  14. In article <DAVIS.92Aug27211418@pacific.mps.ohio-state.edu>,
  15. davis@pacific.mps.ohio-state.edu ("John E. Davis") writes:
  16. > In article <9224107.5975@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU
  17. (Fergus James HENDERSON) writes:
  18. >    Any function that is part of the standard library is a "built-in"
  19. function.
  20.  
  21. Well, I would rather say that any function that is properly prototyped is a
  22. "built-in" function.
  23.  
  24. > Hmm... don't bet on it.  Let's see:
  25. [... program deleted ...]
  26.  
  27. > [8:52pm] /net/pacific/4/davis>cc t.c -lm
  28. > [pacific]
  29. > [8:52pm] /net/pacific/4/davis>./a.out
  30. > 1.000000 = pow(2.000000, 4)
  31. > This was compiled on a sun sparc station.
  32. > Also note that all the comments and documentation in the world couldn't have
  33. > saved this program.
  34.  
  35. The above simply proves you don't have an ANSI C compiler, or at least not ANSI
  36. C header files. I compiled the same program on a Solbourne which is SPARC
  37. compatible, and got this result:
  38.  
  39. 16.000000 = pow(2.000000, 4)
  40.  
  41. The only thing I did was to exchange "#include <math.h>" with "double
  42. pow(double, double);", because our header-files aren't ANSI C yet either. Need
  43. an upgrade. :-)  Conclusion:  The compiler needs to know the types of the
  44. arguments the function takes (naturally), and once it knows that it is
  45. perfectly
  46. able to do type conversion itself.
  47.  
  48. >      _____________
  49. > #___/John E. Davis\_________________________________________________________
  50. > #
  51. > # internet: davis@amy.tch.harvard.edu
  52. > #   bitnet: davis@ohstpy
  53. > #   office: 617-735-6746
  54. > #
  55.  
  56. BJorn.
  57.  
  58.