From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11300 invoked by alias); 30 Jan 2006 07:08:03 -0000 Received: (qmail 11272 invoked by alias); 30 Jan 2006 07:08:00 -0000 Date: Mon, 30 Jan 2006 07:08:00 -0000 Message-ID: <20060130070800.11271.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/26020] std::advance() isn't stable for floating point numbers In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "Woebbeking at web dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg03325.txt.bz2 List-Id: ------- Comment #10 from Woebbeking at web dot de 2006-01-30 07:07 ------- Subject: Re: std::advance() isn't stable for floating point numbers On Monday 30 January 2006 02:09, pcarlini at suse dot de wrote: > ------- Comment #9 from pcarlini at suse dot de 2006-01-30 01:09 > ------- (In reply to comment #7) > > > reading the standard specification let me under the impression that > > Distance is supposed to "related" to difference_type. For example > > the distance between the p before and after calling distance(p, n) > > is supposed to be n. So I would suggest conversion to the > > difference_type of the iterator as a momentary resolution. > > Excellent idea. 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? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26020