-
|
Greetings friends, I'm currently learning my way around Synthea and I'm trying to model a pathology based on prevalence rates that have some decimals. Unfortunately, Synthea somehow turns my distributed percentage of 4.1% (0.041) into 4,1000000000000005 in the graph view, even though I made sure the sum up to exactly 100%. I have no idea why. Does anyone have advice on how to fix this? That would be amazing! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi, this is an issue we've struggled with for a while. You can see other instances in some of our other modules, for example here's a snippet from the pregnancy module: At this point the only 2 options are to either ignore the unsightly extra digits (they shouldn't impact the results in a meaningful way) or to change the value to a number that works better. (Eg, in this case, 0.04 or 0.042 should display as expected, though depending on your module those may be too different from the desired value.) For a little explanation of what's going on, this is one of the limitations of floating point numbers in computers. See: https://0.30000000000000004.com/ |
Beta Was this translation helpful? Give feedback.
-
|
Ah, thank you very much for clearing that up, that makes a ton of sense! I don't particularly worry about the floats, I was just concerned I was already taking a misstep in my model before it advances to a meaningful size. Now that I have the background, I'll probably just revisit the topic in a few months. Thank you very much! |
Beta Was this translation helpful? Give feedback.

Hi, this is an issue we've struggled with for a while. You can see other instances in some of our other modules, for example here's a snippet from the pregnancy module:
At this point the only 2 options are to either ignore the unsightly extra digits (they shouldn't impact the results in a meaningful way) or to change the value to a number that works better. (Eg, in this case, 0.04 or 0.042 should display as expected, though depending on your module those may be too different from the desired value.)
For a little explanation of what's going on, this is one of the limitations of floating point numbers in computers. See: https://0.30000000000000004.com/
It is something we could fix in the m…