From b388aff6904a079e07b35eab376318b9389199fa Mon Sep 17 00:00:00 2001 From: adrpo Date: Fri, 4 Mar 2016 23:30:59 +0100 Subject: [PATCH] - cast to double so that 1/10 doesn't become zero --- Compiler/FrontEnd/Expression.mo | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Compiler/FrontEnd/Expression.mo b/Compiler/FrontEnd/Expression.mo index 903191bf9dd..58d9ba01c24 100644 --- a/Compiler/FrontEnd/Expression.mo +++ b/Compiler/FrontEnd/Expression.mo @@ -1558,7 +1558,10 @@ algorithm case DAE.REAL_CLOCK(e) then e; case DAE.INTEGER_CLOCK(e, er) - then DAE.BINARY(e, DAE.DIV(DAE.T_REAL_DEFAULT), er); + then DAE.BINARY( + DAE.CAST(DAE.T_REAL_DEFAULT, e), + DAE.DIV(DAE.T_REAL_DEFAULT), + DAE.CAST(DAE.T_REAL_DEFAULT, er)); else then DAE.RCONST(0.0); end match;