;; -*-theme-d-*-

;; Copyright (C) 2008-2019 Tommi Höynälänmaa
;; Distributed under GNU Lesser General Public License version 3,
;; see file doc/LGPL-3.

(define-interface (standard-library basic-math)

  (import (standard-library core))

  (declare quotient (:simple-proc (<integer> <integer>) <integer> pure))

  (declare remainder (:simple-proc (<integer> <integer>) <integer> pure))

  (declare integer->real (:simple-proc (<integer>) <real> pure))

  (declare real->integer (:simple-proc (<real>) <integer> pure))

  (declare integer-float? (:simple-proc (<real>) <boolean> pure))

  (declare round (:simple-proc (<real>) <integer> pure))

  (declare truncate (:simple-proc (<real>) <integer> pure))

  (declare floor (:simple-proc (<real>) <integer> pure))

  (declare ceiling (:simple-proc (<real>) <integer> pure))

  (declare r-round (:simple-proc (<real>) <real> pure))

  (declare r-truncate (:simple-proc (<real>) <real> pure))

  (declare r-floor (:simple-proc (<real>) <real> pure))

  (declare r-ceiling (:simple-proc (<real>) <real> pure))

  (declare i-abs (:simple-proc (<integer>) <integer> (pure)))

  (declare r-abs (:simple-proc (<real>) <real> (pure)))

  (declare-method abs (:simple-proc (<integer>) <integer> (pure)))

  (declare-method abs (:simple-proc (<real>) <real> (pure)))

  (declare i-square (:simple-proc (<integer>) <integer> (pure)))

  (declare r-square (:simple-proc (<real>) <real> (pure)))

  (declare-method square (:simple-proc (<integer>) <integer> (pure)))

  (declare-method square (:simple-proc (<real>) <real> (pure)))

  (declare i-nonneg-expt (:simple-proc (<integer> <integer>) <integer> pure))

  (declare r-nonneg-int-expt (:simple-proc (<real> <integer>) <real> (pure)))

  (declare r-int-expt (:simple-proc (<real> <integer>) <real> (pure)))

  (declare gcd (:simple-proc (<integer> <integer>) <integer> pure))

  (declare factorial (:simple-proc (<integer>) <integer> pure))

  (declare i-log10-exact (:simple-proc (<integer>) (:maybe <integer>) pure))
  
  (declare i-log2-exact (:simple-proc (<integer>) (:maybe <integer>) pure))

  (declare i-sign (:simple-proc (<integer>) <integer> pure))

  (declare r-sign (:simple-proc (<real>) <integer> pure))

  (declare-method sign (:simple-proc (<integer>) <integer> pure))

  (declare-method sign (:simple-proc (<real>) <integer> pure))

  (declare nan (:simple-proc () <real> pure))

  (declare inf (:simple-proc () <real> pure))

  (declare neg-inf (:simple-proc () <real> pure))

  (declare nan? (:simple-proc (<real>) <boolean> (pure)))

  (declare infinite? (:simple-proc (<real>) <boolean> (pure)))

  (declare finite? (:simple-proc (<real>) <boolean> (pure))))
