~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to strings/decimal.c

  • Committer: Brian Aker
  • Date: 2008-07-07 14:25:25 UTC
  • mto: (77.1.25 codestyle)
  • mto: This revision was merged to the branch mainline in revision 82.
  • Revision ID: brian@tangent.org-20080707142525-xzy2nl3ie2ebwfln
LL() cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1031
1031
 
1032
1032
  if (from->sign)
1033
1033
  {
1034
 
      *to=ULL(0);
 
1034
      *to= 0ULL;
1035
1035
      return E_DEC_OVERFLOW;
1036
1036
  }
1037
1037
 
2810
2810
  test_f2d(1234500009876.5, 0);
2811
2811
 
2812
2812
  printf("==== ulonglong2decimal ====\n");
2813
 
  test_ull2d(ULL(12345), "12345", 0);
2814
 
  test_ull2d(ULL(0), "0", 0);
2815
 
  test_ull2d(ULL(18446744073709551615), "18446744073709551615", 0);
 
2813
  test_ull2d(12345ULL, "12345", 0);
 
2814
  test_ull2d(0ULL, "0", 0);
 
2815
  test_ull2d(18446744073709551615ULL, "18446744073709551615", 0);
2816
2816
 
2817
2817
  printf("==== decimal2ulonglong ====\n");
2818
2818
  test_d2ull("12345", "12345", 0);
2824
2824
  test_d2ull("9999999999999999999999999.000", "9999999999999999", 2);
2825
2825
 
2826
2826
  printf("==== longlong2decimal ====\n");
2827
 
  test_ll2d(LL(-12345), "-12345", 0);
2828
 
  test_ll2d(LL(-1), "-1", 0);
2829
 
  test_ll2d(LL(-9223372036854775807), "-9223372036854775807", 0);
2830
 
  test_ll2d(ULL(9223372036854775808), "-9223372036854775808", 0);
 
2827
  test_ll2d(12345LL, "-12345", 0);
 
2828
  test_ll2d(1LL, "-1", 0);
 
2829
  test_ll2d(9223372036854775807LL, "-9223372036854775807", 0);
 
2830
  test_ll2d(9223372036854775808ULL, "-9223372036854775808", 0);
2831
2831
 
2832
2832
  printf("==== decimal2longlong ====\n");
2833
2833
  test_d2ll("18446744073709551615", "18446744073", 2);