package Reldb.RelUserCode;

import org.reldb.rel.v0.types.*;
import org.reldb.rel.v0.types.builtin.*;
import org.reldb.rel.v0.types.userdefined.*;
import org.reldb.rel.v0.values.*;
import org.reldb.rel.v0.vm.Context;

public class op_MINIMUM__RATIONAL_RATIONAL {
	private static final ValueRational do_MINIMUM(Context context, ValueRational a, ValueRational b) {
		
		// Returns the smaller of two RATIONAL values.
			return ValueRational.select(context.getGenerator(), Math.min(a.doubleValue(), b.doubleValue()));
	}

	public static final void execute(Context context) {
		ValueRational p1 = (ValueRational)context.pop();
		ValueRational p0 = (ValueRational)context.pop();
		context.push(do_MINIMUM(context, p0, p1));
	}
}