public int lisphashCode(int n) { int r = 19937; for (int i = 0; i < vec.length; i++) { LispObject b = vec[i]; if (b == null) r = 54321 * r; else if (!b.atom) r = 169 * r + ((Cons) b).lisphashCode(b, n - 10); else r = 0x8040201 * r + b.lisphashCode(); } return r; }
public boolean leq(LispObject a) throws Exception { return (value <= a.doubleValue()); }
public boolean ge(LispObject a) throws Exception { return (value > a.doubleValue()); }
public boolean neqn(LispObject a) throws Exception { return (value != a.doubleValue()); }
public LispObject min(LispObject a) throws Exception { return (value <= a.doubleValue() ? this : a); }
public LispObject expt(LispObject a) throws Exception { // it is possible that I should delect cases where a is an integer // and raise to a power using some alternative scheme, like repeated // multiplication. return new LispFloat(Math.pow(value, a.doubleValue())); }
public LispObject remainder(LispObject a) throws Exception { return new LispFloat(value % a.doubleValue()); }
public LispObject divide(LispObject a) throws Exception { return new LispFloat(value / a.doubleValue()); }
public LispObject multiply(LispObject a) throws Exception { return new LispFloat(value * a.doubleValue()); }
public LispObject subtract(LispObject a) throws Exception { return new LispFloat(value - a.doubleValue()); }
public LispObject add(LispObject a) throws Exception { return new LispFloat(value + a.doubleValue()); }
public void print(int fg) throws ResourceException { Jlisp.print("#CALL" + (nargs & 0xf) + "as" + ((nargs >> 4) & 0xf) + "<"); body.print(fg); Jlisp.print(">"); }