Branch Coverage

Ryu.xs
Criterion Covered Total %
branch 122 136 89.7


line true false branch
102 2 18 if(SvIOK(sv)) return 1;
107 4 3 if(SvNOK(sv)) return 1;
112 17 16 if(SvPOK(sv)) return 1;
117 0 0 if(SvIOKp(sv)) return 1;
152 558 2233 if(s[0] == '-') {
160 2564 227 if(s[1] == '.') pointpos = 1;
162 2564 227 if(pointpos) {
165 0 2564 if(man_str == NULL) croak("Failed (in 'if' block) to allocate memory for man_str in fmtpy function");
167 0 2564 if(exp_str == NULL) croak("Failed (in 'if' block) to allocate memory for exp_str in fmtpy function");
173 41506 2564 for(i = 0; i < len; i++) {
174 7790 33716 if(seen) { /* will be set when 'E' is encountered' */
177 2564 31152 else if(s[i] == 'E') {
185 1205 1359 if(exponent > 0 && exponent < MAX_DEC_DIG) {
165 1040 if(exponent > 0 && exponent < MAX_DEC_DIG) {
188 80 85 if(zero_pad >= 0 && (zero_pad + len < MAX_DEC_DIG + 1)) {
64 16 if(zero_pad >= 0 && (zero_pad + len < MAX_DEC_DIG + 1)) {
190 13 51 if(is_neg) man_str[0] = '-';
192 624 64 for(i = 2; i < len; i++) {
195 165 64 for(dec = 0; dec < zero_pad; dec++) {
206 13 51 if(is_neg) s--;
209 85 16 else if(zero_pad < 0) {
214 17 68 if(is_neg) man_str[0] = '-';
218 868 85 for(i = 2; i < len; i++) {
219 85 783 if(i == zero_pad + len) {
231 17 68 if(is_neg) s--;
238 1127 1288 if(exponent < -4 || exponent >= 0) {
1071 56 if(exponent < -4 || exponent >= 0) {
239 471 1888 if(is_neg) man_str[0] = '-';
240 28612 2359 for(i = 0; i < len; i++) man_str[i + is_neg] = s[i];
241 15 2344 if(!exponent) {
246 2 13 if(is_neg) s--;
251 1056 1288 if(exponent > 0) {
254 2812 1056 for(i = 0; i < len; i ++) man_str[dec + i] = exp_str[i];
259 212 844 if(is_neg) s--;
264 53 1235 if(len == 2) {
271 4533 1235 for(i = 0; i < len; i++) man_str[dec + i] = exp_str[i];
277 257 1031 if(is_neg) s--;
282 10 46 if(is_neg) man_str[0] = '-';
287 53 56 for(i = 0; i < (size_t)zero_pad; i++) man_str[i + 2 + is_neg] = '0';
291 638 56 for(i = 2; i < len; i++) man_str[dec + i] = s[i];
296 10 46 if(is_neg) s--;
301 193 34 if(s[0] == 'I') {
302 38 155 if(is_neg) {
305 1 37 if(SvIV(get_sv("Math::Ryu::PERL_INFNAN", 0))) {
313 1 154 if(SvIV(get_sv("Math::Ryu::PERL_INFNAN", 0))) {
320 3 31 if(s[0] == 'N') {
321 0 3 if(is_neg) {
326 2 1 if(SvIV(get_sv("Math::Ryu::PERL_INFNAN", 0))) {
335 0 31 if(exp_str == NULL) croak("Failed (in 'else' block) to allocate memory for exp_str in fmtpy function");
336 121 31 for(i = 2; i <= len; i++) exp_str[i - 2] = s[i];
338 17 14 if(exponent < -9) {
341 4 13 if(is_neg) s--;
346 2 12 if(exponent < -4) {
348 1 1 if(is_neg) exp_str[0] = '-';
357 1 1 if(is_neg) s--;
361 12 0 if(exponent >= 0 && exponent <= MAX_DEC_DIG - 2) {
8 4 if(exponent >= 0 && exponent <= MAX_DEC_DIG - 2) {
363 2 6 if(is_neg) exp_str[0] = '-';
365 48 8 for(dec = 0; dec < exponent; dec++) exp_str[1 + is_neg + dec] = '0';
372 2 6 if(is_neg) s--;
376 4 0 if(exponent > MAX_DEC_DIG - 2) {
378 2 2 if(is_neg) exp_str[0] = '-';
382 8 4 for(i = 2; i < len; i++) exp_str[i + 1 + is_neg] = s[i];
386 2 2 if(is_neg) s--;
394 0 0 if(is_neg) exp_str[0] = '-';
397 0 0 for(dec = -1; dec > exponent; dec--) exp_str[1 + is_neg - dec] = '0';
403 0 0 if(is_neg) s--;
409 1 2 if(arg >= 0) {