On 14/11/11 19:49, George Gallen wrote:
Or didn't know about the INT() command, and forced everything to be even.....

Which in reality, is kinda odd. (Couldn't resist).

:-)

In reality, you could well be correct !!!

When I was involved in recruiting a C programmer ages ago, we set a simple competence test. I lifted a snippet of code from one of OUR OWN programs somewhere that said something like ...

real rr = our value of interest;

int ii = rr*10;

int mm = ( rr - (float(ii)/10) ) * 10;

if (mm>5)
  float rr2 = int( rr + .5 );
else
  float rr2 = int( rr);

We asked the candidates to identify what this code was doing, and could they do it any simpler. We made a point of saying that all we wanted was for them to spot what was going on ...

With only ONE exception, every candidate rewrote it and made it even more convoluted. That one exception got it right ...

rr2 = round( rr);

Cheers,
Wol
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to