On 25 February 2017 at 12:43, Nathaniel Smith wrote:
> FWIW, numpy provides all of the following as separate functions:
>
> * an isclose equivalent
> * nextafter
> * a function for counting the number of ulps between two floats
> * a function for checking that two floats differ by at most N ulps
On Feb 24, 2017 5:29 PM, "David Mertz" wrote:
Marc-André slightly misspelled the recent-ish addition of math.isclose(),
but I agree that it is absolutely where a "nextafter" belongs.
The function signature is already relatively complex to cover several
different but related use cases. I.e.:
Marc-André slightly misspelled the recent-ish addition of math.isclose(),
but I agree that it is absolutely where a "nextafter" belongs.
The function signature is already relatively complex to cover several
different but related use cases. I.e.:
is_close(a, b, *, rel_tol=1e-09, abs_tol=0.0)
On Feb 24, 2017, at 10:28 AM, Mahmoud Hashemi wrote:
By the way, it looks like math doesn't have machine epsilon either:
>
>
> https://en.wikipedia.org/wiki/Machine_epsilon
>
> Pretty sure machine epsilon is in the sys module's float_info object.
Ahh, thanks! I though I remembered it was somewh
By the way, it looks like math doesn't have machine epsilon either:
>
>
> https://en.wikipedia.org/wiki/Machine_epsilon
>
> which would be handy as well.
>
> -CHB
>
>
Pretty sure machine epsilon is in the sys module's float_info object. Or
are you saying it would be handy to alias sys.float_info.ep
On Fri, Feb 24, 2017 at 1:40 AM, Juraj Sukop wrote:
>
>
> On Fri, Feb 24, 2017 at 5:01 AM, Chris Barker
> wrote:
>
>> cause if your computation was that perfect, why not just check for zero?
>>
>>
> A polynomial root may simply be not representable in double precision
> floating-point format.
>
On 24.02.2017 10:13, Nick Coghlan wrote:
> On 6 February 2017 at 20:29, M.-A. Lemburg wrote:
>
>> On 04.02.2017 12:59, Stephan Houben wrote:
>>> Hi all,
>>>
>>> Visual C++ 2015 supports this one:
>>>
>>> https://msdn.microsoft.com/en-us/library/h0dff77w.aspx
>>>
>>> In any case, this is easy to i
On 24.02.2017 05:45, Chris Angelico wrote:
Don't forget that you can rewrite a "for-if" using two additional
lines and no indents, rather than one line and one indent:
for ...:
if not (...):
continue
...
...
That's exactly what I meant by "for+if+continue". At work we e
On Fri, Feb 24, 2017 at 5:01 AM, Chris Barker wrote:
> cause if your computation was that perfect, why not just check for zero?
>
>
A polynomial root may simply be not representable in double precision
floating-point format. Per the example I posted above, the best one can
hope for in such situat
On 6 February 2017 at 20:29, M.-A. Lemburg wrote:
> On 04.02.2017 12:59, Stephan Houben wrote:
> > Hi all,
> >
> > Visual C++ 2015 supports this one:
> >
> > https://msdn.microsoft.com/en-us/library/h0dff77w.aspx
> >
> > In any case, this is easy to implement an efficient fallback in C, unlike
>
10 matches
Mail list logo