[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article

Handling of Complex Numbers in the $C^H$ Programming Language

Published: 01 August 1993 Publication History

Abstract

The handling of complex numbers in the $C^H$ programming language will be described in this paper. Complex is a built-in data type in $C^H$. The I/O, arithmetic and relational operations, and built-in mathematical functions are defined for both regular complex numbers and complex metanumbers of ComplexZero, Complexlnf, and ComplexNaN. Due to polymorphism, the syntax of complex arithmetic and relational operations and built-in mathematical functions are the same as those for real numbers. Besides polymorphism, the built-in mathematical functions are implemented with a variable number of arguments that greatly simplify computations of different branches of multiple-valued complex functions. The valid lvalues related to complex numbers are defined. Rationales for the design of complex features in $C^H$ are discussed from language design, implementation, and application points of views. Sample $C^H$ programs show that a computer language that does not distinguish the sign of zeros in complex numbers can also handle the branch cuts of multiple-valued complex functions effectively so long as it is appropriately designed and implemented.

References

[1]
H. H. Cheng. "Scientific Computing in the CH Programming Language, Department of Mechanical. Aeronautical and Materials Engineering," University of California, Davis, Technical Report TR-MAME-93-101. February 18, 1993.
[2]
ANSI. ANSI Standard X3.9-1978, Programming Language Fortran (revision of ANSI X2.9-1966). New York: ANSI, 1978.
[3]
G.S. Hodgson. "Proposed Standard for Packages of Real and Complex Type Declarations and Basic Operations for Ada (including Vector and Matrix Types)." ACM Ada Lett., vol. XI, 1991, pp. 91-130.
[4]
G. S. Hodgson. "Rationale for Proposed Standard for Packages of Real and Complex Type Declarations and Basic Operations for Ada (including Vector and Matrix Types)." ACM Ada Lett., vol. XI, 1991. pp. 131-139.
[5]
J. S. Squire. "Proposed Standard for a Generic Package of Complex Elementary Functions." ACM Ada Lett., vol. XI, 1991, pp. 140-165.
[6]
J. S. Squire, "Rationale for the Proposed Standard for a Generic Package of Complex Elementary Functions." ACM Ada Lett., vol. XI. 1991. pp. 166-179.
[7]
D. M. Ritchie. and K. L. Thompson, "The unix time-sharing system," Commun. ACM, vol. 17. pp. 365-375, 1974.
[8]
B. W. Kernighan and D. M. Ritehie. The C Programming Language, Englewood Cliffs. NJ: Prentice-Hall. Inc., 1st edition (K & RC): 1978: 2nd edition (ANSI C). 1988.
[9]
B. Stroustrup, The C++ Programming Language. Reading. MA Addison-Wesley. 1987.
[10]
IEEE. ANSI/IEEE Standard 754-1985. IEEE Standard for Binary Floating-Point Arithmetic, Piscataway, NJ: IEEE. 1985.
[11]
ANSI, ANSI Standard X3.159-1989, Programming Language C. New York. ANSI. 1989.
[12]
R. V. Churchill and J. W. Brown. Complex Variables and Applications 4th edition). New York: McGraw-Hill, 1984.
[13]
J. E. Marsden, Basic Complex Analysis. San Francisco, CA: W. H. Freeman. 1973.
[14]
G. L., Steele, Jr., Common Lisp: the Language (2nd edition). Bedford. MA: Digital Press. 1990.
[15]
S. Wolfram, Mathematica: A System for Doing Mathematics by Computer. Redwood City, CA: Addison-Wesley, 1988.
[16]
Math Works, Pro-MATLAB User's Guide. South Natick. MA: The Math Works. Inc., 1990.
[17]
ANSI, ANSI/IEEE Standard 770 X3.97-1983, IEEE Standard Pascal Programming Language. Piscataway, NJ: IEEE. 1983.
[18]
C. Lanczos. "A precision approximation of the gamma function." J. SIAM Numerical Analysis, Ser. B, vol. 1, pp. 86-96, 1964.
[19]
W. H., Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, Numerical Recipes in C: The Art of Scientific Computing. Cambridge, MA: Cambridge University Press. 1990.
[20]
W. Kahan, "Branch cuts for complex elementary functions or much ado about nothing's sign bit." The State of the Art in Numerical Analysis. Oxford' Oxford University Press. pp. 155-211, 1987.
[21]
J. Thomas. Floating-point C extensions. NCEG X3J11.1/93-00, Jan. 20, 1993.
[22]
F. Tydeman, "Merging complex and IEEE-745," Document X3J11.1 (NCEG) 92-061.
[23]
H. H. Cheng, "Computations of dual numbers in the extended finite dual plane," Proceedings of the 1993 ASME Design Automation Conference. Albuquerque and New York: ASME. 1993. pp. 73-80.
[24]
P. Penfield, Jr., "Principal values and branch cuts in complex APL," APL Quote Quad, vol. 12. pp. 248-256, 1981.
[25]
H. Kober, Dictionary of Conformal Representations . New York: Dover Publications. Inc., 1957.
[26]
H. Baker, "Less complex elementary functions," ACM SIGPLAN Notices, vol. 27. pp. 15-16, 1992.
[27]
D. S. Collens. "Algorithm 243: logarithm of a complex number." Collected Algorithms From CACM (vol. II), 1980.
[28]
P. Friedland, "Algorithm 312: absolute value and square root of a complex number." Collected Algorithms From CACM, (vol. II). 1980.
[29]
J. R. Herndon. "Algorithm 46: exponential of a complex number." Collected Algorithms From CACM (vol. I) 1980.
[30]
J. R. Herndon. "Algorithm 48: logarithm of a complex number." Collected Algorithms From CACM (vol. I). 1980.
[31]
J. R. Herndon, "Algorithm 53: nth roots of a complex number," Collected Algorithms From CACM (vol. I), 1980.
[32]
M. L. Johnson and W. Sangren. "Algorithm 106: complex number to a real power." Collected Algorithms From CACM (vol. I), 1980.
[33]
H. Kuki, "Algorithm 421: complex gamma function with error control." Collected Algorithms From CACM (vol. I), 1980.
[34]
C. W. Lucas Jr. and C. W. Terrill, "Algorithm 404: complex gamma function." Collected Algorithms From CACM (vol. I), 1980.
[35]
A. P. Relph, "Algorithm 190" complex power." Collected Algorithms From CACM (vol. I), 1980.
[36]
R. L. Smith, "Algorithm 116: complex division." Collected Algorithms From CACM (vol. I), 1980.
[37]
R. P. Van de Riet, "Algorithm 186: complex arithmetic." Collected Algorithms From CACM (vol. I), 1980.
[38]
Dritz, K. W., "Proposed Standard for a Generic Package of Elementary Functions for Ada," Ada Numerics Standardization and Testing, ACM Ada Letters, vol. XI, No. 7, Fall, 1991, pp. 9-46.
[39]
W. Kahan and J. W. Thomas, "Augmenting a programming language with complex arithmetic," Document X3J11.1 (NCEG), pp. 91- 039.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Scientific Programming
Scientific Programming  Volume 2, Issue 3
August 1993
103 pages

Publisher

IOS Press

Netherlands

Publication History

Published: 01 August 1993

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media