LispPad
  • Home
  • Applications
    • 🖥️LispPad
      • Sessions
      • Editor
      • Preferences
    • 📱LispPad Go
    • 📜Language
    • 📖Libraries
  • Libraries
    • ⚙️LispKit
      • (lispkit archive tar)
      • (lispkit archive zip)
      • (lispkit base)
      • (lispkit bitset)
      • (lispkit box)
      • (lispkit bytevector)
      • (lispkit char)
      • (lispkit char-set)
      • (lispkit combinator)
      • (lispkit comparator)
      • (lispkit control)
      • (lispkit core)
      • (lispkit crypto)
      • (lispkit csv)
      • (lispkit datatype)
      • (lispkit date-time)
      • (lispkit debug)
      • (lispkit disjoint-set)
      • (lispkit draw)
      • (lispkit draw turtle)
      • (lispkit draw barcode)
      • (lispkit draw chart bar)
      • (lispkit dynamic)
      • (lispkit enum)
      • (lispkit format)
      • (lispkit graph)
      • (lispkit gvector)
      • (lispkit hashtable)
      • (lispkit heap)
      • (lispkit http)
      • (lispkit http oauth)
      • (lispkit http server)
      • (lispkit iterate)
      • (lispkit json)
      • (lispkit json schema)
      • (lispkit list)
      • (lispkit list set)
      • (lispkit log)
      • (lispkit markdown)
      • (lispkit match)
      • (lispkit math)
      • (lispkit math matrix)
      • (lispkit math stats)
      • (lispkit math util)
      • (lispkit object)
      • (lispkit port)
      • (lispkit prolog)
      • (lispkit queue)
      • (lispkit record)
      • (lispkit regexp)
      • (lispkit serialize)
      • (lispkit set)
      • (lispkit sqlite)
      • (lispkit stack)
      • (lispkit stream)
      • (lispkit string)
      • (lispkit styled-text)
      • (lispkit system)
      • (lispkit system call)
      • (lispkit system keychain)
      • (lispkit system pasteboard)
      • (lispkit test)
      • (lispkit text-table)
      • (lispkit thread)
      • (lispkit thread channel)
      • (lispkit-thread-future)
      • (lispkit thread shared-queue)
      • (lispkit type)
      • (lispkit url)
      • (lispkit vector)
    • ⚙️LispPad
      • (lisppad applescript)
      • (lisppad draw map)
      • (lisppad location)
      • (lisppad speech)
      • (lisppad system)
      • (lisppad turtle)
    • ⚙️SRFI
  • Examples
    • 📝LispKit
    • 📝LispPad
    • 📝LispPad Go
  • Releases
    • 🖥️LispPad
    • 📱LispPad Go
  • Downloads
  • Privacy Policy
  • Contact
Powered by GitBook
On this page
  1. Libraries
  2. LispKit

(lispkit math util)

Last updated 6 months ago

Library (lispkit math util) implements mathematical utility functions.


(sgn x)

Implements the sign/signum function. Returns -1 if x is negative, 0 (or a signed zero, when inexact) if x is zero, and 1 if x is a positive number. sgn fails if x is not a real number.

(numbers lo hi) (numbers lo hi f) (numbers lo hi guard f)

Returns a list of numbers by iterating from integer lo to integer hi (both inclusive) and applying function f to each integer in the range for which guard returns true. The default guard always returns true. The default for f is identity.

(sum xs)

Returns the sum of all numbers of list xs. This procedure fails if there is an element in xs which is not a number.

(product xs)

Returns the product of all numbers of list xs. This procedure fails if there is an element in xs which is not a number.

(minimum xs)

Returns the minimum of all numbers of list xs. This procedure fails if there is an element in xs which is not a number.

(maximum xs)

Returns the maximum of all numbers of list xs. This procedure fails if there is an element in xs which is not a number.

(conjugate x)

Conjugates number x. For real numbers x, conjugate returns x, otherwise x is being returned with the opposite sign for the imaginary part.

(degrees->radians x)

Converts degrees into radians.

Converts radians into degrees.

Returns #t if integer n is a prime number, #f otherwise.

Returns a NaN whose sign bit is equal to neg (#t for negative, #f for positive), whose quiet bit is equal to quiet (#t for quiet, #f for signaling), and whose payload is the positive exact integer payload. It is an error if payload is larger than a NaN can hold.

Returns #t if the sign bit of x is 1 and #f otherwise.

Returns #t if x is a quiet NaN.

Returns the payload bits of floating-point number x as a positive exact integer.

Returns #t if x and y have the same sign, quiet bit, and payload; and #f otherwise.

(radians->degrees x)

(prime? n)

(make-nan neg quiet payload)

(nan-negative? x)

(nan-quiet? x)

(nan-payload x)

(nan=? x y)

⚙️