Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Add fabs() for CMT since everything in rxode2 should be double
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Dec 6, 2023
1 parent 00f00b9 commit 7956ce1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void codegen(char *model, int show_ode, const char *prefix, const char *libname,
// Hence CMT = 4 could translate in data to 44 with sensi=10
// Then cmt=44 translates back to cmt-10 or 4.
// This makes the sensitivity equations insensitive to CMT changes that occur in FOCEi
sAppend(&sbOut,"#define _CMT ((abs(CMT)<=%d) ? CMT : ((CMT<0) ? CMT+%d: CMT-%d))\n",
sAppend(&sbOut,"#define _CMT ((fabs(CMT)<=%d) ? CMT : ((CMT<0) ? CMT+%d: CMT-%d))\n",

Check warning on line 155 in src/codegen.c

View check run for this annotation

Codecov / codecov/patch

src/codegen.c#L155

Added line #L155 was not covered by tests
baseSize, tb.sensi, tb.sensi);
} else {
sAppendN(&sbOut,"#define _CMT CMT\n", 17);
Expand Down

0 comments on commit 7956ce1

Please sign in to comment.