Re: [Pyobjc-dev] Comparing int and floats fails?
Brought to you by:
ronaldoussoren
From: Francesco P. <fpi...@no...> - 2003-12-17 01:43:54
|
Ummm... For some reason, Python doesn't read my mind: it keeps reading my code, instead! :-) I was comparing strings and floats, of course... Cheers fra On Dec 15, 2003, at 2:39 AM, Just van Rossum wrote: > Francesco Pierfederici wrote: > >> for some weird reason, if all of v, z1 and z2 are floats, everything >> works as expected. If v is a int while z1 and z2 are floats, the >> second statement gets ALWAYS executed. I should add that z in an >> element of a Python array of unsigned ints. >> >> Has anybody ever seen something like this? > > int/float comparisons work as expected in Python. Are you sure the > objects you're comparing have the types you expect? Maybe one is a > string and not a number? Try putting "print type(v), type(z1), > type(z2)" > somewhere. > > Just > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |