Numbers

The only numbers recognized by STK are integers (with arbitrary precision) and reals (implemented as C double floats).





`=̀13`(ndexfile(index-entry "number?" "tt" main )number?obj)
procedure
Returns #t if obj is a number, otherwise returns #f.





`=̀13`(ndexfile(index-entry "complex?" "tt" main )complex?obj)
procedure
Returns the same result as number?. Note that complex numbers are not implemented.





`=̀13`(ndexfile(index-entry "real?" "tt" main )real?obj)
procedure
Returns #t if obj is a float number, otherwise returns #f.





`=̀13`(ndexfile(index-entry "rational?" "tt" main )rational?obj)
procedure
Returns the same result as number?. Note that rational numbers are not implemented.





`=̀13`(ndexfile(index-entry "integer?" "tt" main )integer?obj)
procedure
Returns #t if obj is an integer, otherwise returns #f.
Note: The STK interpreter distinguishes between integers which fit in a C long int (minus 8 bits) and integers of arbitrary length (aka ``bignums''). This should be transparent to the user, though.





`=̀13`(ndexfile(index-entry "exact?" "tt" main )exact?z)
procedure
`=̀13`(ndexfile(index-entry "inexact?" "tt" main )inexact?z)
procedure
In this implementation, integers (C long int or ``bignums'') are exact numbers and floats are inexact.





`=̀13`(ndexfile(index-entry "=" "tt" main )=z1 z2 z3 … )
procedure
`=̀13`(ndexfile(index-entry "<" "tt" main )<x1 x2 x3 … )
procedure
`=̀13`(ndexfile(index-entry ">" "tt" main )>x1 x2 x3 … )
procedure
`=̀13`(ndexfile(index-entry "<=" "tt" main )<=x1 x2 x3 … )
procedure
`=̀13`(ndexfile(index-entry ">=" "tt" main )>=x1 x2 x3 … )
procedure
`=̀13`(ndexfile(index-entry "zero?" "tt" main )zero?z)
procedure
`=̀13`(ndexfile(index-entry "positive?" "tt" main )positive?z)
procedure
`=̀13`(ndexfile(index-entry "negative?" "tt" main )negative?z)
procedure
`=̀13`(ndexfile(index-entry "odd?" "tt" main )odd?z)
procedure
`=̀13`(ndexfile(index-entry "even?" "tt" main )even?z)
procedure
`=̀13`(ndexfile(index-entry "max" "tt" main )maxx1 x2 … )
procedure
`=̀13`(ndexfile(index-entry "min" "tt" main )minx1 x2 … )
procedure
`=̀13`(ndexfile(index-entry "+" "tt" main )+z1 … )
procedure
`=̀13`(ndexfile(index-entry "*" "tt" main )*z1 … )
procedure
`=̀13`(ndexfile(index-entry "-" "tt" main )-z1 z2)
procedure
`=̀13`(ndexfile(index-entry "-" "tt" main )-z)
procedure
`=̀13`(ndexfile(index-entry "-" "tt" main )-z1 z2 … )
procedure
`=̀13`(ndexfile(index-entry "/" "tt" main )/z1 z2)
procedure
`=̀13`(ndexfile(index-entry "/" "tt" main )/z)
procedure
`=̀13`(ndexfile(index-entry "/" "tt" main )/z1 z2 … )
procedure
`=̀13`(ndexfile(index-entry "abs" "tt" main )absx)
procedure
`=̀13`(ndexfile(index-entry "quotient" "tt" main )quotientn1 n2)
procedure
`=̀13`(ndexfile(index-entry "remainder" "tt" main )remaindern1 n2)
procedure
`=̀13`(ndexfile(index-entry "modulo" "tt" main )modulon1 n2)
procedure
`=̀13`(ndexfile(index-entry "gcd" "tt" main )gcdn1 … )
procedure
`=̀13`(ndexfile(index-entry "lcm" "tt" main )lcmn1 … )
procedure
Identical to R4RS.





`=̀13`(ndexfile(index-entry "numerator" "tt" main )numeratorq)
procedure
`=̀13`(ndexfile(index-entry "denominator" "tt" main )denominatorq)
procedure
Not implemented.





`=̀13`(ndexfile(index-entry "floor" "tt" main )floorx)
procedure
`=̀13`(ndexfile(index-entry "ceiling" "tt" main )ceilingx)
procedure
`=̀13`(ndexfile(index-entry "truncate" "tt" main )truncatex)
procedure
`=̀13`(ndexfile(index-entry "round" "tt" main )roundx)
procedure
Identical to R4RS.





`=̀13`(ndexfile(index-entry "rationalize" "tt" main )rationalizex y)
procedure
not yet implemented.





`=̀13`(ndexfile(index-entry "exp" "tt" main )expz)
procedure
`=̀13`(ndexfile(index-entry "log" "tt" main )logz)
procedure
`=̀13`(ndexfile(index-entry "sin" "tt" main )sinz)
procedure
`=̀13`(ndexfile(index-entry "cos" "tt" main )cosz)
procedure
`=̀13`(ndexfile(index-entry "tan" "tt" main )tanz)
procedure
`=̀13`(ndexfile(index-entry "asin" "tt" main )asinz)
procedure
`=̀13`(ndexfile(index-entry "acos" "tt" main )acosz)
procedure
`=̀13`(ndexfile(index-entry "atan" "tt" main )atanz)
procedure
`=̀13`(ndexfile(index-entry "atan" "tt" main )atany x)
procedure
`=̀13`(ndexfile(index-entry "sqrt" "tt" main )sqrtz)
procedure
`=̀13`(ndexfile(index-entry "expt" "tt" main )exptz1 z2)
procedure
Identical to R4RS.





`=̀13`(ndexfile(index-entry "make-rectangular" "tt" main )make-rectangularx1 x2)
procedure
`=̀13`(ndexfile(index-entry "make-polar" "tt" main )make-polarx1 x2)
procedure
`=̀13`(ndexfile(index-entry "real-part" "tt" main )real-partz)
procedure
`=̀13`(ndexfile(index-entry "imag-part" "tt" main )imag-partz)
procedure
`=̀13`(ndexfile(index-entry "magnitude" "tt" main )magnitudez)
procedure
`=̀13`(ndexfile(index-entry "angle" "tt" main )anglez)
procedure
These procedures are not implemented since complex numbers are not defined.





`=̀13`(ndexfile(index-entry "exact->inexact" "tt" main )exact->inexactz)
procedure
`=̀13`(ndexfile(index-entry "inexact->exact" "tt" main )inexact->exactz)
procedure
`=̀13`(ndexfile(index-entry "number->string" "tt" main )number->stringnumber)
procedure
`=̀13`(ndexfile(index-entry "number->string" "tt" main )number->stringnumber radix)
procedure
`=̀13`(ndexfile(index-entry "string->number" "tt" main )string->numberstring)
procedure
`=̀13`(ndexfile(index-entry "string->number" "tt" main )string->numberstring radix)
procedure
Identical to R4RS.