Skip to content

Commit

Permalink
Rename "functions" module to "commons"
Browse files Browse the repository at this point in the history
  • Loading branch information
hchasestevens committed Mar 10, 2017
1 parent dee46b8 commit 92806e1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 197 deletions.
File renamed without changes.
52 changes: 52 additions & 0 deletions monkeys/common/numeric.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Common numeric functions."""

import functools
from numbers import Real

from monkeys.typing import params, rtype, ignore


@params(Real, Real)
@rtype(Real)
def add(x, y):
return x + y


@params(Real, Real)
@rtype(Real)
def sub(x, y):
return x - y


@params(Real, Real)
@rtype(Real)
@ignore(float('NaN'), ZeroDivisionError)
def mod(x, y):
return x % y


@params(Real, Real)
@rtype(Real)
def mul(x, y):
return x * y


@params(Real, Real)
@rtype(Real)
@ignore(float('NaN'), ZeroDivisionError)
def div(x, y):
return x / y


@params(Real, Real)
@rtype(Real)
@ignore(float('NaN'), ZeroDivisionError)
def exp(x, y):
return x ** y


@params(Real)
@rtype([Real])
@ignore([], Exception)
def num_range(x):
return list(range(int(x)))
197 changes: 0 additions & 197 deletions monkeys/functions/numeric.py

This file was deleted.

0 comments on commit 92806e1

Please sign in to comment.