Skip to content

Commit

Permalink
add epsilon
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Aug 5, 2023
1 parent cfda16c commit 9c9d929
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/built-in-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,24 @@ Math
>>> ExampleContract.foo(3.1337)
4
.. py:function:: epsilon(typename) -> Any
Returns the smallest non-zero value for a decimal type.

* ``typename``: Name of the decimal type (currently only ``decimal``)

.. code-block:: python
@external
@view
def foo() -> decimal:
return epsilon(decimal)
.. code-block:: python
>>> ExampleContract.foo()
Decimal('1E-10')
.. py:function:: floor(value: decimal) -> int256
Round a decimal down to the nearest integer.
Expand Down

0 comments on commit 9c9d929

Please sign in to comment.