// Copyright (c) 1996-2002 Brian D. Carlstrom

package bdc.scheme.procedure;

import bdc.scheme.Scheme;
import bdc.scheme.SchemeException;
import bdc.scheme.Stack;
import bdc.scheme.expression.Procedure2;
import bdc.util.Constants;

/**
    (remainder x y)
*/
public class Remainder extends Procedure2
{
    public Object apply2 (Stack stack) throws SchemeException
    {
        Object o1 = stack.array[stack.inUse-1];
        Object o2 = stack.array[stack.inUse-2];
        return Constants.getInteger(Scheme.number(o1, this).intValue() %
                                    Scheme.number(o2, this).intValue());
    }
}
