News for hackers. Stuff that matters.
Re:How One Missing `var` Ruined our Launch by swanson on Monday October 31, 2011 @07:17PM (#3179628)
Ha, that reminds me of a program I was writing in MATLAB. I used `i` for a loop index in one part of the script and then later when doing some complex number calculations (`2 + 3i`)...it was one of those so-stupid-you-have-to-laugh moments when I finally figured it out.
Re:How One Missing `var` Ruined our Launch by joeyo on Monday October 31, 2011 @10:21PM (#3180282)
It's for this precise reason that I use 1i rather than i when doing complex arithmetic in matlab.
Re:How One Missing `var` Ruined our Launch by ajross on Tuesday November 01, 2011 @11:45AM (#3182591)
Wait... matlab allows "AB" to be inferred as "A*B"? How is that not a disaster? Parsing a token that doesn't even exist in the lexer stream? Even C++ wouldn't try that.
Re:How One Missing `var` Ruined our Launch by gujk on Tuesday November 01, 2011 @12:04PM (#3182687)
1i is special, sort of like 1d or 1f in C. The i refers to the imaginary number datatype. i also can be reassigned, which is a horrible design bug in Matlab.