Skip to content

Commit

Permalink
docs: epsilon builtin (vyperlang#3552)
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg authored Aug 5, 2023
1 parent 855f734 commit b878899
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 b878899

Please sign in to comment.