> On July 7, 2017, 8:36 p.m., Greg Mann wrote:
> > 3rdparty/stout/include/stout/duration.hpp
> > Line 35 (original), 35 (patched)
> > <https://reviews.apache.org/r/60524/diff/1/?file=1766697#file1766697line35>
> >
> >     Consider updating this to return an error in case of over/underflow, 
> > like `create()`.

Done in https://reviews.apache.org/r/60721/


> On July 7, 2017, 8:36 p.m., Greg Mann wrote:
> > 3rdparty/stout/include/stout/duration.hpp
> > Lines 121 (patched)
> > <https://reviews.apache.org/r/60524/diff/1/?file=1766697#file1766697line121>
> >
> >     two slashes only

:blush:


> On July 7, 2017, 8:36 p.m., Greg Mann wrote:
> > 3rdparty/stout/include/stout/duration.hpp
> > Lines 149-150 (patched)
> > <https://reviews.apache.org/r/60524/diff/1/?file=1766697#file1766697line149>
> >
> >     Investigate if this is easy to do now.

After some research on floating point operations, I learned about the existence 
of negative and positive infinity values.

If a double operation overflows, the result is a value that is bigger (or 
smaller if the number is negative) than any double.

I removed these TODOs and added extra expectations to the tests.


- Gastón


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60524/#review179932
-----------------------------------------------------------


On July 7, 2017, 11:59 p.m., Gastón Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60524/
> -----------------------------------------------------------
> 
> (Updated July 7, 2017, 11:59 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Greg Mann, 
> and Vinod Kone.
> 
> 
> Bugs: MESOS-7661
>     https://issues.apache.org/jira/browse/MESOS-7661
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Made the `Duration` arithmetic operators return `Duration::max()` if the
> operation would result in an integer overflow, and `Duration::min()` if
> it would result in an underflow.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/duration.hpp 
> b0cd77b833f6fbf752b4db820fd43b87e1d1e476 
>   3rdparty/stout/tests/duration_tests.cpp 
> 59b08f14849a8db31f11fbd0b2e1248c99afd9dd 
> 
> 
> Diff: https://reviews.apache.org/r/60524/diff/2/
> 
> 
> Testing
> -------
> 
> Added new Stout tests and confirmed that the Mesos test suite still passes.
> 
> 
> Thanks,
> 
> Gastón Kleiman
> 
>

Reply via email to