Re: [MP3 ENCODER] castings (OT)

2000-09-19 Thread Gabriel Bouvigne
It's taken from: Kerningham Richie: Programming in C It's not a compiler, but a book. The German translation is *different* from the original. Some additional remarks are taken from the ANSI Standard (1990). Highly respectable source, but parts of the KR syntax are now deprecated in

Re: [MP3 ENCODER] castings

2000-09-18 Thread Frank Klemm
:: :: 1) one type is long double, the other will be casted to long double :: 2) one type is double, the other will be casted to double :: 3) one type is float, the other will be casted to float Fully wrong. The rest I haven't checked. -- Mit freundlichen Grüßen Frank Klemm eMail |

Re: [MP3 ENCODER] castings

2000-09-18 Thread Frank Klemm
:: :: Albert you are right, but this shows that it is necessary to be :: resolved, not casted. :: Compile programs with gnatmake, not with gcc ;-) -- Mit freundlichen Grüßen Frank Klemm PS: Ada programs are compiled with gnatmake. Make functionality is part of Ada itself. eMail |

Re: [MP3 ENCODER] castings

2000-09-18 Thread Leonid A. Kulakov
Hi Frank, :: :: 1)one type is long double, the other will be casted to long double :: 2)one type is double, the other will be casted to double :: 3)one type is float, the other will be casted to float Fully wrong. The rest I haven't checked. Does it mean

Re: [MP3 ENCODER] castings

2000-09-18 Thread Robert Hegemann
Frank Klemm schrieb am Mon, 18 Sep 2000: :: :: 1)one type is long double, the other will be casted to long double :: 2)one type is double, the other will be casted to double :: 3)one type is float, the other will be casted to float Fully wrong. The rest I

Re: [MP3 ENCODER] castings

2000-09-18 Thread Frank Klemm
:: Hi Frank, :: :: :: :: :: 1)one type is long double, the other will be casted to long double :: :: 2)one type is double, the other will be casted to double :: :: 3)one type is float, the other will be casted to float :: Fully wrong. :: The rest I haven't checked.

Re: [MP3 ENCODER] castings

2000-09-18 Thread Frank Klemm
:: Albert Faber schrieb am Son, 17 Sep 2000: :: Robert, :: So if i have the following piece of code :: ::int my_signed= -1; ::unsigned int my_unsigned=10; :: ::if (my_signedmy_unsigned) :: printf("my_singed my_unsigned\n"); :: else :: printf("my_singed is =

Re: [MP3 ENCODER] castings

2000-09-18 Thread Robert Hegemann
Frank Klemm schrieb am Mon, 18 Sep 2000: :: Hi Frank, :: :: :: :: :: 1) one type is long double, the other will be casted to long double :: :: 2) one type is double, the other will be casted to double :: :: 3) one type is float, the other will be casted to float ::

Re: [MP3 ENCODER] castings

2000-09-18 Thread Frank Klemm
On Sun, Sep 17, 2000 at 11:44:01PM +0200, Albert Faber wrote: Lets take: float x = 1.5; longy = 1234567890; double z = x * y; printf ("%30.12f\n", z); 1) one type is long double, the other will be casted to long double Not fulfilled. 2) one type is double, the other will be

Re: [MP3 ENCODER] castings (OT)

2000-09-18 Thread Frank Klemm
On Mon, Sep 18, 2000 at 08:17:46PM +0200, Robert Hegemann wrote: a) char, signed char, short = int b) unsigned char, unsigned short = unsigned int c) float = double So your Compiler/target CPU has only an affinity for some elementary types. This is

Re: [MP3 ENCODER] castings

2000-09-18 Thread Mathew Hendry
From: "Frank Klemm" [EMAIL PROTECTED] #include stdio.h float x1 = 1.e30; float x2 = 1.e31; float x3 = 1.e32; int main ( void ) { float x4; x4 = x1*x2*x3 / (x1*x2 + x2*x3 + x3*x1); printf ( "%g\n", x4 ); return 0; } The code line x4=... is equivalent to x4

Re: [MP3 ENCODER] castings

2000-09-18 Thread Mathew Hendry
From: "Frank Klemm" [EMAIL PROTECTED] a) char, signed char, short = int unless int cannot represent all possible values of char, in which case char = unsigned int b) unsigned char, unsigned short = unsigned int if int can represent all possible values unsigned char, unsigned

[MP3 ENCODER] castings

2000-09-17 Thread Robert Hegemann
Hi all, I see a tendency that compiler warnings get casted away. The problem is, that these castings make your compiler happy, but there is a high potential that this only covers BUGS. Everytime someone will cast away compiler warnings he should back up his change with an assertion! For

Re: [MP3 ENCODER] castings

2000-09-17 Thread Albert Faber
To: [EMAIL PROTECTED] Sent: Sunday, September 17, 2000 6:50 PM Subject: [MP3 ENCODER] castings Hi all, I see a tendency that compiler warnings get casted away. The problem is, that these castings make your compiler happy, but there is a high potential that this only covers BUGS. Everytime someone will

Re: [MP3 ENCODER] castings

2000-09-17 Thread Robert Hegemann
Albert Faber schrieb am Son, 17 Sep 2000: Robert, And if you don't cast it, you will leave it up to the compiler, thus the behavior becomes compiler specfic, will it cast the unsigned to a signed or will it cast the signed to an unsigned value. What does happen, if you don't cast, and assign

Re: [MP3 ENCODER] castings

2000-09-17 Thread Albert Faber
From: "Robert Hegemann" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, September 17, 2000 10:34 PM Subject: Re: [MP3 ENCODER] castings Albert Faber schrieb am Son, 17 Sep 2000: Robert, And if you don't cast it, you will leave it up to the compiler, thus the behavior becomes com

Re: [MP3 ENCODER] castings

2000-09-17 Thread Robert Hegemann
Albert Faber schrieb am Son, 17 Sep 2000: Robert, So if i have the following piece of code int my_signed= -1; unsigned int my_unsigned=10; if (my_signedmy_unsigned) printf("my_singed my_unsigned\n"); else printf("my_singed is = my_unsigned\n"); It should print: "my_singed