Subject:
|
Re: egcs compiler - float problems?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Fri, 10 May 2002 20:37:28 GMT
|
Viewed:
|
2565 times
|
| |
| |
Michael Obenland <obenland@t-online.de> wrote:
> int main(int argc, char *argv[]) {
> double foo = 1.0;
> return foo > 0.1 ? 0 : 1;
> }
I have not tried to compile this, but one thing that looks suspicious is
that you are using doubles. Doubles are not supported. The compiler I
have (some old version of GCC) treats doubles and floats as the same type.
The compiler you're using might not be doing that. I wouldn't know how to
go about fixing this, except the obvious workaround:
int main(int argc, char *argv[]) {
float foo = 1.0f;
return foo > 0.1f ? 0 : 1;
}
I don't know if that will work, but if it does it's a clue as to what might
be going wrong.
-Kekoa
|
|
Message is in Reply To:
| | egcs compiler - float problems?
|
| Can someone using the egcs compiler suite test the following code? It seems it doesn't compile under egcs. int main(int argc, char *argv[]) { double foo = 1.0; return foo > 0.1 ? 0 : 1; } Compiles fine under gcc 3.0.3. Regards, Michael (23 years ago, 10-May-02, to lugnet.robotics.rcx.legos)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|