This commit is contained in:
zeroflag 2021-07-02 14:21:11 +02:00
parent 59ccc85f92
commit c188719c08
2 changed files with 6 additions and 2 deletions

View file

@ -228,7 +228,10 @@ public class Num implements Obj, LogicOperand, ArithmeticOperand {
@Override @Override
public boolean boolValue() { public boolean boolValue() {
if (STRICT)
throw new TypeMismatched(this, "bool"); throw new TypeMismatched(this, "bool");
else
return value.longValue() != 0l;
} }
@Override @Override

View file

@ -16,3 +16,4 @@
: ms ( n -- ) 'java.lang.Thread/sleep/l' jvm-call-static ; : ms ( n -- ) 'java.lang.Thread/sleep/l' jvm-call-static ;
: tone ( hz ms -- ) swap 'com.vectron.forthcalc.support.Tone/play/di' jvm-call-static ; : tone ( hz ms -- ) swap 'com.vectron.forthcalc.support.Tone/play/di' jvm-call-static ;
: torch ( n -- ) 'com.vectron.forthcalc.support.Torch/toggle/O' jvm-call-static ;