Look at the followint run output:
[code]cint : C/C++ interpreter (mailing list ‘cint@root.cern.ch’)
Copyright© : 1995~2005 Masaharu Goto (gotom@hanno.jp)
revision : 5.16.11, April 14, 2006 by M.Goto
No main() function found in given source file. Interactive interface started.
’?’:help, ‘.q’:quit, ‘statement’,’{statements;}’ or ‘.p [expr]’ to evaluate
cint> {
end with ‘}’, ‘@’:abort > for (int i=0;i<10;i++) {
end with ‘}’, ‘@’:abort > printf("%f\n",(2.0 &&1.0>0 ? sqrt(0.04) : -666.));
end with ‘}’, ‘@’:abort > }
end with ‘}’, ‘@’:abort > }
0.200000
-666.000000
-666.000000
-666.000000
-666.000000
-666.000000
-666.000000
-666.000000
-666.000000
-666.000000
cint>
[/code]
Why the conditional statement (Z?X:Y) fails from the second iteration? I can’t figure out.
Note this bug will happen in general codes.