Changeset 3567
- Timestamp:
- 09/04/03 00:16:39 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r3565 r3567 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.36 7 2003-09-03 23:44:01piso Exp $5 * $Id: Primitives.java,v 1.368 2003-09-04 00:16:39 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 4815 4815 } 4816 4816 4817 // ### gcd-2 4818 private static final Primitive2 GCD_2 = 4819 new Primitive2("gcd-2", PACKAGE_SYS, false) 4820 { 4821 public LispObject execute(LispObject first, LispObject second) 4822 throws LispError 4823 { 4824 BigInteger n1, n2; 4825 if (first instanceof Fixnum) 4826 n1 = BigInteger.valueOf(((Fixnum)first).getValue()); 4827 else if (first instanceof Bignum) 4828 n1 = ((Bignum)first).getValue(); 4829 else 4830 throw new TypeError(first, "integer"); 4831 if (second instanceof Fixnum) 4832 n2 = BigInteger.valueOf(((Fixnum)second).getValue()); 4833 else if (second instanceof Bignum) 4834 n2 = ((Bignum)second).getValue(); 4835 else 4836 throw new TypeError(second, "integer"); 4837 return number(n1.gcd(n2)); 4838 } 4839 }; 4840 4817 4841 // ### hashcode-to-string 4818 4842 private static final Primitive1 HASHCODE_TO_STRING =
Note: See TracChangeset
for help on using the changeset viewer.