From: Jaeger, D. <dj...@em...> - 2015-07-23 01:24:31
|
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 } 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/ ________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). |