Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Conditions

Name: Anonymous 2011-09-03 10:01

Is it not possible to use
if(0<x<10){}

or do you have to use
if(x>0&&x<10){}

?

Name: Anonymous 2011-09-03 19:14

Python and Lisp work like that, there might be other languages that I don't know about.

In most languages (like C), 0 < x will evaluate to 0 or 1, so you get 1 < 10. This is assuming that the language converts true and false to 1 or 0.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List