| 2686 | } |
| 2687 | |
| 2688 | void test_d2b2d(const char *str, int p, int s, const char *orig, int ex) |
| 2689 | { |
| 2690 | char s1[100], *end; |
| 2691 | uchar buf[100]; |
| 2692 | int res, i, size=decimal_bin_size(p, s); |
| 2693 | |
| 2694 | snprintf(s1, sizeof(s1), "'%s'", str); |
| 2695 | end= strend(str); |
| 2696 | string2decimal(str, &a, &end); |
| 2697 | res=decimal2bin(&a, buf, p, s); |
| 2698 | printf("%-31s {%2d, %2d} => res=%d size=%-2d ", s1, p, s, res, size); |
| 2699 | if (full) |
| 2700 | { |
| 2701 | printf("0x"); |
| 2702 | for (i=0; i < size; i++) |
| 2703 | printf("%02x", ((uchar *)buf)[i]); |
| 2704 | } |
| 2705 | res=bin2decimal(buf, &a, p, s); |
| 2706 | printf(" => res=%d ", res); |
| 2707 | print_decimal(&a, orig, res, ex); |
| 2708 | printf("\n"); |
| 2709 | } |
| 2710 | |
| 2711 | void test_f2d(double from, int ex) |
| 2712 | { |
no test coverage detected