X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedjclass.cpp;h=ac3e94eaffaa8ac339935a97267c56b0d4e832db;hb=8dd3c225255d7084e3aff8740aa4f1f1cabb367a;hp=d44f22f17645b4e373404d33a60509574a0ef392;hpb=74844a60d80c6dd06e3fb02ee9b928424f9019b0;p=mothur.git diff --git a/sharedjclass.cpp b/sharedjclass.cpp index d44f22f..ac3e94e 100644 --- a/sharedjclass.cpp +++ b/sharedjclass.cpp @@ -13,7 +13,7 @@ EstOutput Jclass::getValues(vector shared) { try { - int S1, S2, S12, tempA, tempB; + double S1, S2, S12, tempA, tempB; S1 = 0; S2 = 0; S12 = 0; tempA = 0; tempB = 0; /*S1, S2 = number of OTUs observed or estimated in A and B @@ -34,7 +34,7 @@ EstOutput Jclass::getValues(vector shared) { if ((tempA != 0) && (tempB != 0)) { S12++; } } - data[0] = S12 / (float)(S1 + S2 - S12); + data[0] = 1.0 - S12 / (float)(S1 + S2 - S12); if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }