Re: [patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Jonathan Wakely
On 02/05/15 19:07 +0200, Marc Glisse wrote: On Sat, 2 May 2015, Jonathan Wakely wrote: On 02/05/15 18:27 +0200, Marc Glisse wrote: On Sat, 2 May 2015, Jonathan Wakely wrote: These where simple to implement (almost too simple ... I probably got something wrong!) I didn't remember that std::

Re: [patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Marc Glisse
On Sat, 2 May 2015, Jonathan Wakely wrote: std::abs seems to work fine for unsigned, the overload in for integral types just uses __builtin_fabs. http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2192 That overload should die. -- Marc Glisse

Re: [patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Marc Glisse
On Sat, 2 May 2015, Jonathan Wakely wrote: On 02/05/15 18:27 +0200, Marc Glisse wrote: On Sat, 2 May 2015, Jonathan Wakely wrote: These where simple to implement (almost too simple ... I probably got something wrong!) I didn't remember that std::abs works for unsigned. It will need more wor

Re: [patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Jonathan Wakely
On 02/05/15 18:27 +0200, Marc Glisse wrote: On Sat, 2 May 2015, Jonathan Wakely wrote: These where simple to implement (almost too simple ... I probably got something wrong!) I didn't remember that std::abs works for unsigned. It will need more work for performance, but that can certainly be

Re: [patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Marc Glisse
On Sat, 2 May 2015, Jonathan Wakely wrote: These where simple to implement (almost too simple ... I probably got something wrong!) I didn't remember that std::abs works for unsigned. It will need more work for performance, but that can certainly be done later (I didn't look at the code beyon

[patch] std::experimental::gcd and std::experimental::lcd

2015-05-02 Thread Jonathan Wakely
These where simple to implement (almost too simple ... I probably got something wrong!) Tested powerpc64le-linux, committed to trunk. (Apart from using common_type_t, which is easy to change, these functions meet the simpler rules for C++11 constexpr, so moving them out of would probably allow