Page 2 of 2

Re: How to calculate size of a COMP-3 and COMP variables

PostPosted: Tue Oct 04, 2016 2:55 am
by Robert Sample
jygboy, you are responding to a topic that originated 8 and 1/2 years ago, even though it was updated more than 4 years ago -- by someone similarly answering a years-old question. Furthermore, you overly complicate the calculation -- (number of digits + 1) / 2 gives a value that either ends with .0 or .5. If .5, round up to next integer, otherwise just use the integer part of the result.