[v3] c++0x std::ratio implementation

Chris Fairles chris.fairles@gmail.com
Sun Jun 29 20:23:00 GMT 2008


I'm assuming std::ratio has been accepted which could very well be
wrong. If it has (or good chance it will be) then I've attached an
implmentation based off of N2615 (
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2615.html#ratio
). One notable issue is std::ratio_less. I've just left the naive
impl. but I think I have a way that avoids overflow using the
coefficients of the continued fraction representation. Still trying to
nail down the algorithm. Any thoughts/suggestions/concerns welcome.

Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_ratio.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080629/2fa19f34/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Changelog_ratio.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080629/2fa19f34/attachment-0001.txt>


More information about the Libstdc++ mailing list