public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Support for IEEE754
@ 2004-04-15 17:29 JOLY Loic
  2004-04-15 17:50 ` llewelly
  2004-04-15 20:35 ` Gabriel Dos Reis
  0 siblings, 2 replies; 4+ messages in thread
From: JOLY Loic @ 2004-04-15 17:29 UTC (permalink / raw)
  To: gcc-help

Hello,

I recently tried the following code (platform : PC/Linux, gcc version 3.2) :

#include <limits>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
	cout << "is IEEE754   = " << numeric_limits<double>::is_iec559<<endl;
	cout << "has infinity = " << numeric_limits<double>::has_infinity<<endl;

	cout << "infinity > 100 ? " << (numeric_limits<double>::infinity() 
 >100) <<endl;
	cout << "infinity= " <<numeric_limits<double>::infinity()<<endl;
	
	return 1;
}

It shows that gcc does not handle the IEEE 754 standard on this 
platform, even if support for this standard is available on this 
processor (The same program run on win/mscv on the same computer shows 
handling for IEEE754).

Is there any compiler flag, or anything, to make gcc compatible with 
this standard? Is there any (good) reason why gcc is not and will never 
be compliant?

Best regards,

-- 
Loïc



-- Disclaimer ------------------------------------
Ce message ainsi que les eventuelles pieces jointes constituent une correspondance prive et confidentielle a l'attention exclusive du destinataire designe ci-dessus. Si vous n'etes pas le destinataire du present message ou une personne susceptible de pouvoir le lui delivrer, il vous est signifie que toute divulgation, distribution ou copie de cette transmission est strictement interdite. Si vous avez recu ce message par erreur, nous vous remercions d'en informer l'expediteur par telephone ou de lui retourner le present message, puis d'effacer immediatement ce message de votre systeme.
***
This e-mail and any attachments is a confidential correspondence intended only for use of the individual or entity named above. If you are not the intended recipient or the agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by phone or by replying this message, and then delete this message from your system.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for IEEE754
  2004-04-15 17:29 Support for IEEE754 JOLY Loic
@ 2004-04-15 17:50 ` llewelly
  2004-04-16  8:26   ` JOLY Loic
  2004-04-15 20:35 ` Gabriel Dos Reis
  1 sibling, 1 reply; 4+ messages in thread
From: llewelly @ 2004-04-15 17:50 UTC (permalink / raw)
  To: JOLY Loic; +Cc: gcc-help

JOLY Loic <loic.joly@renault.com> writes:

> Hello,
> 
> I recently tried the following code (platform : PC/Linux, gcc version 3.2) :
> 
> #include <limits>
> #include <iostream>
> 
> using namespace std;
> 
> int main(int argc, char *argv[])
> {
> 	cout << "is IEEE754   = " << numeric_limits<double>::is_iec559<<endl;
> 	cout << "has infinity = " << numeric_limits<double>::has_infinity<<endl;
> 
> 	cout << "infinity > 100 ? " <<
> (numeric_limits<double>::infinity() >100) <<endl;
> 	cout << "infinity= " <<numeric_limits<double>::infinity()<<endl;
> 	
> 	return 1;
> }
> 
> It shows that gcc does not handle the IEEE 754 standard on this
> platform, even if support for this standard is available on this
> processor (The same program run on win/mscv on the same computer shows
> handling for IEEE754).
> 
> Is there any compiler flag, or anything, to make gcc compatible with
> this standard?

Yes; get a current version of gcc. Compiled with gcc 3.3.3, your
    program prints:

is IEEE754   = 1
has infinity = 1
infinity > 100 ? 1
infinity= inf

which shows that it implements IEEE754 at least well enough to pass
    the trivial test you used on the other compiler.

> Is there any (good) reason why gcc is not and will
> never be compliant?

It has always been the intent of the gcc team to implement 
    relevant standards such as IEEE754, ISO 14882, posix, etc. However
    these standards are extrodinarily complex, and like other
    implementors, the gcc team has finite resources. If you find any
    bugs, please report them, see gcc.gnu.org/bugs.html . They will be
    pleased if you do, and make every effort to fix them.

So 'will never' has always been false, and 'is not' is false at least
    with respect to your test case. (though other bugs remain) The
    result is that you appear to be either deliberately insulting,
    grossly ignorant, or both. So in the future, please avoid
    statements that appear to make such statements.
    


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for IEEE754
  2004-04-15 17:29 Support for IEEE754 JOLY Loic
  2004-04-15 17:50 ` llewelly
@ 2004-04-15 20:35 ` Gabriel Dos Reis
  1 sibling, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2004-04-15 20:35 UTC (permalink / raw)
  To: JOLY Loic; +Cc: gcc-help

JOLY Loic <loic.joly@renault.com> writes:

| Hello,
| 
| I recently tried the following code (platform : PC/Linux, gcc version 3.2) :

Recent versions of GCC (e.g. GCC-3.3.x) have better support for <limits>.

-- Gaby

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for IEEE754
  2004-04-15 17:50 ` llewelly
@ 2004-04-16  8:26   ` JOLY Loic
  0 siblings, 0 replies; 4+ messages in thread
From: JOLY Loic @ 2004-04-16  8:26 UTC (permalink / raw)
  To: llewelly; +Cc: gcc-help

llewelly@xmission.com wrote:
> JOLY Loic <loic.joly@renault.com> writes:

[...]

>>It shows that gcc does not handle the IEEE 754 standard on this
>>platform, even if support for this standard is available on this
>>processor (The same program run on win/mscv on the same computer shows
>>handling for IEEE754).
>>
>>Is there any compiler flag, or anything, to make gcc compatible with
>>this standard?
> 
> 
> Yes; get a current version of gcc. Compiled with gcc 3.3.3, your
>     program prints:
> 
> is IEEE754   = 1
> has infinity = 1
> infinity > 100 ? 1
> infinity= inf

Great. I will look if I can make my team upgrade.


> which shows that it implements IEEE754 at least well enough to pass
>     the trivial test you used on the other compiler.
> 
> 
>>Is there any (good) reason why gcc is not and will
>>never be compliant?
> 
> 
> It has always been the intent of the gcc team to implement 
>     relevant standards such as IEEE754, ISO 14882, posix, etc. However
>     these standards are extrodinarily complex, and like other
>     implementors, the gcc team has finite resources. If you find any
>     bugs, please report them, see gcc.gnu.org/bugs.html . They will be
>     pleased if you do, and make every effort to fix them.
> 
> So 'will never' has always been false, and 'is not' is false at least
>     with respect to your test case. (though other bugs remain) The
>     result is that you appear to be either deliberately insulting,
>     grossly ignorant, or both. So in the future, please avoid
>     statements that appear to make such statements.


I am sorry if I did not make my point clear. English is not my natural 
language. I just tried to explore with my questions all possible cases. 
I never tried to be insulting.

I asked wether :
- It was there but I did not know how to activate it
- It was not there but it was going to come soon ("is not") (and it 
appears that this was the case)
- It was not there and was never going to be there ("will not be") 
(probably for a good reason, such as bad support from the FPU)

It is true when I read back my mail, especially when you separate the 
two questions that were in the same paragraph, my wording may be 
understood differently that what I intended.

Regards,

-- 
Loïc





-- Disclaimer ------------------------------------
Ce message ainsi que les eventuelles pieces jointes constituent une correspondance prive et confidentielle a l'attention exclusive du destinataire designe ci-dessus. Si vous n'etes pas le destinataire du present message ou une personne susceptible de pouvoir le lui delivrer, il vous est signifie que toute divulgation, distribution ou copie de cette transmission est strictement interdite. Si vous avez recu ce message par erreur, nous vous remercions d'en informer l'expediteur par telephone ou de lui retourner le present message, puis d'effacer immediatement ce message de votre systeme.
***
This e-mail and any attachments is a confidential correspondence intended only for use of the individual or entity named above. If you are not the intended recipient or the agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by phone or by replying this message, and then delete this message from your system.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-16  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-15 17:29 Support for IEEE754 JOLY Loic
2004-04-15 17:50 ` llewelly
2004-04-16  8:26   ` JOLY Loic
2004-04-15 20:35 ` Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).