"Strong typing vs. strong testing"

Paul Rubin no.email at nospam.invalid
Thu Sep 30 17:25:36 EDT 2010


TheFlyingDutchman <zzbbaadd at aol.com> writes:
> With Tiny C on my system, your code does not cause maximum to give an
> incorrect value, or to blow up:
>
> int maximum(int a, int b)
> {
>   printf("entering maximum %d %d\n",a,b);
>   if ( a > b )
>     return a;
>   else
>     return b;
> }

What did printf show as "b" when you ran it?  If that code worked at
all, it was by accident.  Try changing the name "maximum" to "minimum"
and change the ">" to "<", compile the same program, and see if you
still get a correct value.



More information about the Python-list mailing list