~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/decimal.cc

  • Committer: Stewart Smith
  • Date: 2009-10-08 12:54:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1179.
  • Revision ID: stewart@flamingspork.com-20091008125437-gj8kxjxlaiazubli
removeĀ unusedĀ decimal_size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1425
1425
}
1426
1426
 
1427
1427
/*
1428
 
  Returns the size of array to hold a decimal with given precision and scale
1429
 
 
1430
 
  RETURN VALUE
1431
 
    size in dec1
1432
 
    (multiply by sizeof(dec1) to get the size if bytes)
1433
 
*/
1434
 
 
1435
 
int decimal_size(int precision, int scale)
1436
 
{
1437
 
  assert(scale >= 0 && precision > 0 && scale <= precision);
1438
 
  return ROUND_UP(precision-scale)+ROUND_UP(scale);
1439
 
}
1440
 
 
1441
 
/*
1442
1428
  Returns the size of array to hold a binary representation of a decimal
1443
1429
 
1444
1430
  RETURN VALUE