Monday, June 13, 2005

Programmers Only

If you are a programmer you will enjoy this:
s=1;
if(s>nsep){
fprintf(stderr, "spacing too large. will be reset to 1\n");
s=1;
}
if(s==1)
nbin=ngrid;

2 Comments:

Anonymous Anonymous said...

Could you translate for those of us who don't speak programming? :-)

Mom

7:24 AM  
Blogger Kevin said...

s is a variable, like in math.
it starts out by setting s=1.
In the first if {} it basically says that if such and such is bad, set s=1.
In the second if statement, it sets the variable nbin to the same number as ngrid if s=1. So basically it sets s to one (twice), and then checks to see if it is one.

I might add that i found this code in a program i'm editing for work.

8:44 PM  

Post a Comment

<< Home