From: Cengiz G. <cg...@em...> - 2015-07-22 21:20:38
|
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/ |