Bug 5527 - incorrect support for infinity in `numeric_limits<double|float>' on Linux/Intel
Summary: incorrect support for infinity in `numeric_limits<double|float>' on Linux/Intel
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.0.3
: P3 normal
Target Milestone: ---
Assignee: Gabriel Dos Reis
Keywords: wrong-code
Depends on:
Reported: 2002-01-29 01:06 UTC by coola
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host: i586-pc-linux-gnu
Target: i586-pc-linux-gnu
Build: i586-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:

nlimits_bug.ii.bz2 (60.10 KB, application/octet-stream)
2003-05-21 15:17 UTC, coola

Note You need to log in before you can comment on or make changes to this bug.
Description coola 2002-01-29 01:06:01 UTC
	infinity definition in `numeric_limits' for `float' and `double'
        is missing on the platform while it obviously should not


System: Linux localhost 2.2.14-5.0 #19 Tue Jul 24 02:12:27 NOVST 2001 i586 unknown
Architecture: i586

host: i586-pc-linux-gnu
build: i586-pc-linux-gnu
target: i586-pc-linux-gnu
configured with: ../gcc-3.0.3/configure --enable-languages=c,c++ --disable-nls

See attachments for nlimits_bug.ii.bz2
Comment 1 coola 2002-01-29 01:06:01 UTC
	fix STL source code. In my opinion the `limits' header should
        be shaped during the configuration process for every particular
Comment 2 Paolo Carlini 2002-01-30 04:48:14 UTC
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-Why: Gaby, I'm assigning this to you as the <limits> maintainer.
Comment 3 Paolo Carlini 2002-01-30 04:48:14 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: This is the testcase at issue:
    #include <iostream>
    #include <limits>
    int main()
        if (std::numeric_limits<double>::has_infinity)
            std::cout << std::numeric_limits<double>::infinity() << '\n';
        return 0;
    In my opinion, returning char(), being has_infinity false,
    cannot be considered wrong from the point of view of
    standard conformance. However, on i686-linux, we could
    expect has_infinity == true and infinity returning "inf",
    Cheers, Paolo.
Comment 4 Paolo Carlini 2002-01-31 14:15:44 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: I'm closing the PR, since it is in fact a known issue, 
    documented by libstdc++/3865.
    However, Gaby, it would be nice if you could state in some
    more detail your position, perhaps as part of 3865 audit
    trail. Is it a QoI issue? Are you actually working on
    something related?
    Thanks, Paolo.
Comment 5 Gabriel Dos Reis 2002-01-31 17:21:14 UTC
From: Gabriel Dos Reis <gdr@codesourcery.com>
To: paolo@gcc.gnu.org
Cc: coola@ngs.ru, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gdr@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/5527: incorrect support for infinity in `numeric_limits<double|float>' on Linux/Intel
Date: 31 Jan 2002 17:21:14 +0100

 paolo@gcc.gnu.org writes:
 |     standard conformance. However, on i686-linux, we could
 That is a known issue.
 -- Gaby