This is an individual project for CS119 Principles and Practice of Computer Algorithms in the second semester. In this project I realize the calculation part of the algorithmic language "Scheme", which is a dialect of the Lisp programming language invented at the MIT AI Lab.
Specifically, this job requires the following:
Equal judgment: equal?, string=?, string-ci=?, char=?, char-ci=?
Type conversion: number->string, string->number, char->integer, integer->char
Computation: See below
String operation: string?, make-string, string, string-length, string-ref, string<? string-ci<?, string<=? string-ci<=?, substring, string-append, string-copy Character operation: char?, char<? char-ci<?, char<=? char-ci<=? char-alphabetic?, char-numeric?, char-whitespace?, char-upper-case?, char-lower-case?, char->integer, integer->char, char-upcase, char-downcase
Basic arithmetic operations: +, -, *, /, abs, quotient, remainder, modulo, gcd, lcm, expt, sqrt
Fractional calculation: numerator, denominator
Approximation: floor, ceiling, truncate, round
Accuracy: inexact->exact, exact->inexact, exact?, inexact?
Judgments: <, <=, >, >=
Judgments: zero?, negative?, positive? odd? even?
Min Max: max, min
Trigonometric function: sin, cos, tan, asin, acos, atan
Power and logarithm: exp, log
Complex operations: make-rectangular, make-polar, real-part, imag-part, magnitude, angle
Type judgment: integer?, rational?, real?, complex?, number?