Groovy web console

subscribe to the feed Subscribe
to this
site
thing (via #groovywebconsole)
tweet this snippet Tweet
this
script

thing

Published 3 months ago by test with tags stuff
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
public boolean posNeg(int a, int b, boolean negative) {
    if(negative == false && ((a>0 && b<0)||(a<0 && b>0))) {
        return true;
    } else if(negative == true && (a<0 && b<0)) {
        return true;
    } else {
        return false;
    }
}

println posNeg(1, 2, false);