Talk:Integer comparison: Difference between revisions

Line 5:
Does the Perl example output the relation between the two numbers? I don't know Perl, but it doesn't look like it prints anything. --[[User:Mwn3d|Mwn3d]] 07:26, 25 April 2008 (MDT)
: An old comment, I know. But yes, the Perl function needs to be wrapped in code to get user input and display the result. Fixed. --[[User:Snoman|Snoman]] 11:06, 12 July 2010 (UTC)
 
== when would two *integers* fail to compare? ==
 
You might as well ask what is the point of the task? If the point is to exercise the three comparison operators and observe that only one of them evaluates to true, then all of the posted solutions that use else if, switch, cond, or similar short circuit forms are incorrect. The reference solutions originally posted by the task author did exercise all three operators for any valid input without short circuiting. My Go solution was anomalously sophisticated, I know. It not only exercised all three operators, but went on to programmatically validate that exactly one operator returned true and that the other two returned false. —[[User:Sonia|Sonia]] 04:09, 28 June 2011 (UTC)
1,707

edits