can someone help me translate this into visual basic
x = (t_x < pi)? : (x - ( sign( x ) *( 2*pi) ))
function sign(X)
just returns a 1 if x is positive and a -1 if it is negitive
can someone help me translate this into visual basic
x = (t_x < pi)? : (x - ( sign( x ) *( 2*pi) ))
function sign(X)
just returns a 1 if x is positive and a -1 if it is negitive
Looks invalid to me, since there's no return value between the ? and :.
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
Sorry it should be:
x = (t_x < pi)? x: (x - ( sign( x ) *( 2*pi) ))
Well without knowing vb, an easier to convert syntax would be:
Code:if ( !(t_x < pi) ) x = x - sign(x) * (2 * pi);
So it would read:
if t_x not less then pi then x=x-sign(x) *(2*pi)
Correct??
Well just did a search for "vb tutorial" on google, and the first site got me enough info to give you this:
Of course I don't have any way of testing itCode:If t_x >= pi Then x = x - sign(x) * 2 * pi;
thanks