.. include:: ../../global.rst Arithmetic ^^^^^^^^^^ .. _`even?`: .. idio:function:: even? x is `x` even? :param x: number :type x: number :return: ``#t`` if `x` is even, ``#f`` otherwise :rtype: boolean .. _`odd?`: .. idio:function:: odd? x is `x` odd? :param x: number :type x: number :return: ``#t`` if `x` is odd, ``#f`` otherwise :rtype: boolean .. _`zero?`: .. idio:function:: zero? o test if `o` is the numeric value zero a fixnum or a bignum with the value zero :param o: object to test :return: ``#t`` if `o` is zero, ``#f`` otherwise .. _`positive?`: .. idio:function:: positive? x is `x` greater than 0? :param x: number :type x: number :return: ``#t`` if `x` is greater than zero, ``#f`` otherwise :rtype: boolean .. _`negative?`: .. idio:function:: negative? x is `x` less than 0? :param x: number :type x: number :return: ``#t`` if `x` is less than zero, ``#f`` otherwise :rtype: boolean .. _`abs`: .. idio:function:: abs n .. _`quotient`: .. idio:function:: quotient a b return the quotient `a / b` :param a: number :type a: fixnum or bignum :param b: number :type b: fixnum or bignum :return: quotient of `a / b` :rtype: fixnum or bignum .. _`expt`: .. idio:function:: expt x y raise `x` to the power of `y` :param x: number :type x: number :param y: number :type y: number :return: `x` to the power `y` :rtype: number .. seealso:: :ref:`exp ` .. _`gcd`: .. idio:function:: gcd [a] return the greatest common divisor of the numbers in `a` :param a: list of numbers :type a: list :return: greatest common divisor :rtype: number If no numbers are provided the result is 0. .. _`lcm`: .. idio:function:: lcm [a] return the least common multiple of the numbers in `a` :param a: list of numbers :type a: list :return: lowest common multiple :rtype: number If no numbers are provided the result is 1. .. _`max`: .. idio:function:: max a [b] return the largest of the numbers in `a` and the numbers in the list `b` :param a: number :type a: number :param b: list of numbers :type b: list :return: largest number :rtype: number If any number is inexact the result is inexact. .. _`min`: .. idio:function:: min a [b] return the smallest of the numbers in `a` and the numbers in the list `b` :param a: number :type a: number :param b: list of numbers :type b: list :return: smallest number :rtype: number If any number is inexact the result is inexact. .. _`remainder`: .. idio:function:: remainder a b return the remainder of `a` less `floor (b)` :param a: number :type a: fixnum or bignum :param b: number :type b: fixnum or bignum :return: remainder of `a` modulo `floor(b)` :rtype: fixnum or bignum .. _`modulo`: .. idio:function:: modulo a b return `a` modulo `b` :param a: number :type a: integer :param b: number :type b: integer :return: `a` module `b` :rtype: integer .. _`floor`: .. idio:function:: floor a return the floor of `a` :param a: number :type a: fixnum or bignum :return: floor of `a` :rtype: integer .. _`ceiling`: .. idio:function:: ceiling x return the smallest `integer` less than `x` :param x: number :type x: number :return: smallest integer less than `x` :rtype: integer .. _`round`: .. idio:function:: round x return the `integer` closest to `x` :param x: number :type x: number :return: integer closest to `x` :rtype: integer .. _`truncate`: .. idio:function:: truncate x return the `integer` furthest from 0 but no further than `x` :param x: number :type x: number :return: integer furthest from 0 but not further than `x` :rtype: integer .. _`factorial`: .. idio:function:: factorial x Return the factorial of `x` :param x: number :type x: number :return: factorial of `x` :rtype: number .. _`exp`: .. idio:function:: exp x raise Euler's number, `e`, to the power of `x` :param x: number :type x: number :return: `e` to the power `x` :rtype: number .. seealso:: :ref:`expt ` and :ref:`log ` .. _`log`: .. idio:function:: log x return the natural logarithm of `x` :param x: number :type x: positive number :return: natural log of `x` :rtype: number .. seealso:: :ref:`exp ` .. _`cos`: .. idio:function:: cos x return the cosine of `x` :param x: number :type x: number :return: cosine of `x` :rtype: number .. _`sin`: .. idio:function:: sin x return the sine of `x` :param x: number :type x: number :return: sine of `x` :rtype: number .. _`tan`: .. idio:function:: tan x return the tangent of `x` :param x: number :type x: number :return: tangent of `x` :rtype: number .. _`atan`: .. idio:function:: atan x return the arctangent of `x` :param x: number :type x: number :return: arctangent of `x` :rtype: number .. _`acos`: .. idio:function:: acos x return the arccosine of `x` :param x: number :type x: number :return: arccosine of `x` :rtype: number .. _`asin`: .. idio:function:: asin x return the arcsine of `x` :param x: number :type x: number :return: arcsine of `x` :rtype: number .. _`sqrt`: .. idio:function:: sqrt square return the square root of `square` :param square: number :type square: number :return: square root of `square` :rtype: number .. include:: ../../commit.rst