From: Cengiz G. <cg...@em...> - 2015-07-22 22:34:57
|
Thanks, Dieter. I realized it must be an integer overflow after I sent out the message. Also the discrepancy I was working on to debug was totally my fault! :) It turns out I missed to update the values in some compartments. -Cengiz On Wed, Jul 22, 2015 at 5:50 PM, Jaeger, Dieter <dj...@em...> wrote: > I think you overflowed your integer welcome. If you shorten your > numbers by a few digits you will do much better. Of course forcing to > float is even better. Not sure where the digits that an int can’t hold > actually go. It could be bad, i.e. random memory overwrite. -Dieter > > > > *From:* Cengiz Günay [mailto:cg...@em...] > *Sent:* Wednesday, July 22, 2015 4:49 PM > *To:* gen...@li... > *Subject:* [Genesis-sim-users] Weird arithmetic error in Genesis > > > > Hi, > > I have been pulling my hair trying to debug arithmetic inconsistencies in > Genesis that are caused by large truncation errors from simplest > calculations and inconsistent PI definitions, which I realize have been > known and we need to be cautious about. However, I wanted to report > something really disturbing: > > > echo { 2012303744.1 / 3658733824.0 } > 0.5500000385 > > echo { 2012303744.1 / 3658733824 <%203658733824> } > 0.9370519524 > > Does anyone have an explanation for this behavior? This can cause > seriously wrong calculations and hidden bugs. > > I think the take home message is to always put a .0 behind integer numbers > that are going to be in floating point calculations. :) > > Best, > > -Cengiz > > -- > Cengiz Gunay > Postdoctoral Fellow, Dept. of Biology > Visiting Faculty, Dept. of Math & CS > Emory University > http://www.biology.emory.edu/research/Prinz/Cengiz/ > |