factor/native/ratio.c

18 lines
411 B
C
Raw Normal View History

2004-08-04 22:43:58 -04:00
#include "factor.h"
2004-09-18 22:29:29 -04:00
/* Does not reduce to lowest terms, so should only be used by math
library implementation, to avoid breaking invariants. */
void primitive_from_fraction(void)
{
2004-12-24 02:52:02 -05:00
CELL denominator = dpop();
CELL numerator = dpop();
F_RATIO* ratio;
maybe_garbage_collection();
2004-12-24 02:52:02 -05:00
ratio = allot(sizeof(F_RATIO));
ratio->numerator = numerator;
ratio->denominator = denominator;
dpush(tag_ratio(ratio));
2004-08-04 22:43:58 -04:00
}