[med-svn] samtools 05/26: Use floor(x+0.5) instead of C99's round()

Charles Plessy plessy at moszumanska.debian.org
Tue Dec 10 10:06:25 UTC 2013


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch debian/unstable
in repository samtools.

commit b140662dec40bf0f87ce34edf147fbf4cbc9f23d
Author: John Marshall <jm18 at sanger.ac.uk>
Date:   Mon Nov 25 13:28:14 2013 +0000

    Use floor(x+0.5) instead of C99's round()
---
 bam2bcf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bam2bcf.c b/bam2bcf.c
index 4b1ed29..5201233 100644
--- a/bam2bcf.c
+++ b/bam2bcf.c
@@ -417,7 +417,7 @@ void calc_SegBias(const bcf_callret1_t *bcr, bcf_call_t *call)
     if ( !nr ) return;
 
     int avg_dp = (call->anno[0] + call->anno[1] + nr) / call->n;    // average depth
-    double M   = round((double)nr / avg_dp);   // an approximate number of variants samples in the population
+    double M   = floor((double)nr / avg_dp + 0.5);   // an approximate number of variants samples in the population
     if ( M>call->n ) M = call->n;       // clamp M at the number of samples
     else if ( M==0 ) M = 1;
     double f = M / 2. / call->n;        // allele frequency

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/samtools.git



More information about the debian-med-commit mailing list