From 1fa0036008a532af4a7b6477ae019db059463088 Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Mon, 10 Jan 2011 10:15:42 +1100 Subject: [PATCH] fix arithmetic error --- gcode_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcode_parse.c b/gcode_parse.c index 2b4f481..c9a74e9 100644 --- a/gcode_parse.c +++ b/gcode_parse.c @@ -66,7 +66,7 @@ int32_t decfloat_to_int(decfloat *df, int32_t multiplicand, int32_t denominator) // r /= denominator; int32_t rnew1 = r * (multiplicand / denominator); - int32_t rnew2 = r * (multiplicand % denominator); + int32_t rnew2 = r * (multiplicand % denominator) / denominator; r = rnew1 + rnew2; // sign