[Python-ideas] PEP 485: A Function for testing approximate equality

Antoine Pitrou solipsis at pitrou.net
Fri Jan 23 22:23:41 CET 2015

On Fri, 23 Jan 2015 15:15:39 -0600
Skip Montanaro <skip.montanaro at gmail.com>
> In these situations you need to
> recognize when the floating point value you have is within some small
> tolerance equal to a price on an exact tick boundary. Furthermore,
> these comparisons need to take into account the different tick sizes
> of different contracts, The CME's Yen/USD futures contract (6Y) has a
> tick size (minimum change between two valid prices) of $.000001 while
> their Euro/USD futures contract (6E) has a tick size of $.0001.

If you have such a precise requirement (the given tick size), you have
to roll your own function, there's no point in a stdlib function, right?



More information about the Python-ideas mailing list