C数值算法程序大全 c1-1_第1页
C数值算法程序大全 c1-1_第2页
C数值算法程序大全 c1-1_第3页
C数值算法程序大全 c1-1_第4页
C数值算法程序大全 c1-1_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 1.2 Some C Conventions for Scientic Computing 15 if (julian >= IGREG Cross-over to Gregorian Calendar produces this correcjalpha=(long(float (julian-1867216-0.25/36524.25; tion. ja=julian+1+jalpha-(long (0.25*jalpha; else if (julian < 0 Make day number positive by adding integer number of ja=

2、julian+36525*(1-julian/36525; Julian centuries, then subtract them o else at the end. ja=julian; jb=ja+1524; jc=(long(6680.0+(float (jb-2439870-122.1/365.25; jd=(long(365*jc+(0.25*jc; je=(long(jb-jd/30.6001; *id=jb-jd-(long (30.6001*je; *mm=je-1; if (*mm > 12 *mm -= 12; *iyyy=jc-4715; if (*mm >

3、; 2 -(*iyyy; if (*iyyy <= 0 -(*iyyy; if (julian < 0 iyyy -= 100*(1-julian/36525; Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5 Copyright (C 1988-1992 by Cambridge University Press.Programs Copyright (C 1988-1992 by Numerical Recipes Software. Perm

4、ission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMs visit website or call 1-800-8

5、72-7423 (North America only,or send email to tradecup.cam.ac.uk (outside North America. (For additional calendrical algorithms, applicable to various historical calendars, see 8. CITED REFERENCES AND FURTHER READING: Harbison, S.P., and Steele, G.L., Jr. 1991, C: A Reference Manual, 3rd ed. (Englewo

6、od Cliffs, NJ: Prentice-Hall. Kernighan, B.W. 1978, The Elements of Programming Style (New York: McGraw-Hill. 1 Yourdon, E. 1975, Techniques of Program Structure and Design (Englewood Cliffs, NJ: PrenticeHall. 2 Jones, R., and Stewart, I. 1987, The Art of C Programming (New York: Springer-Verlag. 3

7、Hoare, C.A.R. 1981, Communications of the ACM, vol. 24, pp. 7583. Wirth, N. 1983, Programming in Modula-2, 3rd ed. (New York: Springer-Verlag. 4 Stroustrup, B. 1986, The C+ Programming Language (Reading, MA: Addison-Wesley. 5 Borland International, Inc. 1989, Turbo Pascal 5.5 Object-Oriented Program

8、ming Guide (Scotts Valley, CA: Borland International. 6 Meeus, J. 1982, Astronomical Formulae for Calculators, 2nd ed., revised and enlarged (Richmond, VA: Willmann-Bell. 7 Hatcher, D.A. 1984, Quarterly Journal of the Royal Astronomical Society, vol. 25, pp. 5355; see also op. cit. 1985, vol. 26, pp

9、. 151155, and 1986, vol. 27, pp. 506507. 8 1.2 Some C Conventions for Scientic Computing The C language was devised originally for systems programming work, not for scientic computing. Relative to other high-level programming languages, C puts the programmer “very close to the machine” in several re

10、spects. It is operator-rich, giving direct access to most capabilities of a machine-language instruction set. It has a large variety of intrinsic data types (short and long, signed and unsigned integers; oating and double-precision reals; pointer types; etc., and a concise syntax for effecting conversions and indirections. It denes

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论