From 20de73bb10a09a52c2be23acddb7cabbd6e6644d Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 20 May 2019 20:10:56 +0100 Subject: [PATCH] Replace modulo with multiply operator, fixes #24 --- sim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim.c b/sim.c index 32d4577..84cc348 100644 --- a/sim.c +++ b/sim.c @@ -577,12 +577,12 @@ END_OPERATOR BEGIN_OPERATOR(modulo) LOWERCASE_REQUIRES_BANG; + PORT(0, -1, IN); PORT(0, 1, IN); - PORT(0, 2, IN); PORT(1, 0, OUT); - Usz ia = index_of(PEEK(0, 1)); - Usz ib = index_of(PEEK(0, 2)); - POKE(1, 0, indexed_glyphs[ib == 0 ? 0 : (ia % ib)]); + Usz ia = index_of(PEEK(0, -1)); + Usz ib = index_of(PEEK(0, 1)); + POKE(1, 0, indexed_glyphs[ia * ib]); END_OPERATOR BEGIN_OPERATOR(offset)