Scientific Computing in the CH Programming Language

Harry H. Cheng

ABSTRACT

We have developed a general-purpose block-structured interpretive programming language. The syntax and semantics of this language called CH are similar to C. CH retains most features of C from the scientific computing point of view. In this paper, the extension of C to CH for numerical computation of real numbers will be described. Metanumbers of -0.0, 0.0, Inf, -Inf, and NaN are introduced in CH. Through these metanumbers, the power of the IEEE-754 arithmetic standard is easily available to the programmer. These metanumbers are extended to commonly used mathematical functions in the spirit of the IEEE 754 standard and ANSI C. The definitions for manipulation of these metanumbers in I/O; arithmetic, relational, and logic operations; and built-in polymorphic mathematical functions are defined. The capabilities of bitwise, assignment, address and indirection, increment and decrement, as well as type conversion operations in ANSI C are extended in CH. In this paper, mainly new linguistic features of CH in comparison to C will be described. Example programs programmed in CH with metanumbers and polymorphic mathematical functions will demonstrate capabilities of CH in scientific computing.


Integration Engineering Laboratory
Webmaster@iel.ucdavis.edu
Created by Harry H. Cheng, 2/24/1995