This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26020] std::advance() isn't stable for floating point numbers
- From: "Woebbeking at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2006 12:03:55 -0000
- Subject: [Bug libstdc++/26020] std::advance() isn't stable for floating point numbers
- References: <bug-26020-8082@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from Woebbeking at web dot de 2006-01-30 12:03 -------
Subject: Re: std::advance() isn't stable for floating point numbers
On Monday 30 January 2006 08:54, gdr at integrable-solutions dot net
wrote:
> ------- Comment #11 from gdr at integrable-solutions dot net
> | FYI, I suggested tests for > 0 and < 0 as MSVC 7.1 does it that
> | way.
> |
> | If you convert Distance to difference_type the question is what
> | happens if Distance is i.e. 0.2. Do you advance by 0 or 1 position?
>
> does not that follow from the conversion rule?
Of course. I meant what should it do. Do you want it to advance by 0 or
1 position? Do we just use a simple cast or do we need to do some
rounding? AFAIK MSVC advance by 1 in this case.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26020