On 16/11/11 16:18, Jacques G. wrote:
Why does your example have : Real which is a type found in languages of the
Pascal family such as: Pascal, Modula2 and possibly Delphi . (Considered
obsolete in Delphi)
:-)
btw, I've never programmed in a Pascal-like language, despite having a
go at Modula-2 ages ago...
in a program which uses C family syntax ? C++, C#, Java none of which have
the Real type.
Maybe it's because I cut my teeth on Fortran? And I haven't programmed
in anger in C for a while.
Anyways, I did say "something like" - I'm remembering back to some time
in the mid-90s.
Cheers,
Wol
________________________________
From: Wols Lists<[email protected]>
To: [email protected]
Sent: Monday, November 14, 2011 4:44 PM
Subject: Re: [U2] Simplify, or why mathematicians make better programmers
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
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users