husk-scheme-3.7: R5RS Scheme interpreter, compiler, and library.

Portability portable experimental github.com/justinethier Safe-Inferred

Language.Scheme.Numerical

Description

This module implements the numerical tower.

Synopsis

# Generic functions

Subtract the given numbers

Multiply the given numbers

Divide the given numbers

Add the given numbers

Take the modulus of the given numbers

Convert the given number to a rational

Numeric equals

Numeric greater than

Numeric greater than equal

Numeric less than

Numeric less than equal

Accept two numbers and cast one of them to the appropriate type, if necessary

Take the denominator of the given number

Take the numerator of the given number

Convert an inexact number to exact

Convert an exact number to inexact

Convert a number to a string; radix is optional, defaults to base 10

Extract an integer from the given value, throwing a type error if the wrong type is passed.

numericBinop :: (Integer -> Integer -> Integer) -> [LispVal] -> ThrowsError LispValSource

A helper function to perform a numeric operation on two values

# Floating point functions

Floor the given number

Take the ceiling of the given number

Truncate the given number

Round the given number

Raise the first number to the power of the second

Take the square root of the given number

Take the exponent of the given number

Compute the log of a given number

Sine

Cosine

Tangent

Arcsine

Arccosine

Arctangent

# Complex functions

Arguments

 :: LispVal Real part -> LispVal Imaginary part -> ThrowsError LispVal Complex number

Create a complex number

Create a complex number from its magnitude and phase (angle)

Retrieve real part of a complex number

Retrieve imaginary part of a complex number

The nonnegative magnitude of a complex number

The phase of a complex number

Create a complex number given its real and imaginary parts

# Predicates

Predicate to determine if given number is complex. Keep in mind this does not just look at the types

Predicate to determine if given number is a real. Keep in mind this does not just look at the types

Predicate to determine if given number is a rational. Keep in mind this does not just look at the types

Predicate to determine if given number is an integer. Keep in mind this does not just look at the types; a floating point input value can return true, for example.

Predicate to determine if given value is a number

A utility function to determine if given value is a floating point number representing an whole number (integer).