Rounding measurements

Status
Not open for further replies.

wwhitney

Senior Member
Location
Berkeley, CA
Occupation
Retired
My original post question only has to do with the question of whether rounding up and down vs truncating can produce the same result in a measurement process. The answer is yes.
Yes, qualified by a fixed difference in calibration prior to rounding or truncating. IOW, for the case of generating an integer from a real number (which is what you are doing, up to shifting a decimal point), ROUND(X) = FLOOR(X + 0.5).

Cheers, Wayne
 

wwhitney

Senior Member
Location
Berkeley, CA
Occupation
Retired
BTW, wouldn't it be more accurate to use a properly calibrated measurement process to the nearest 0.001"? I'm thinking of the case that the "exact" measurement is, say, 0.00546", which the measurement process is likely to call 0.0055", which would then get rounded to 0.006". It would be somewhat better to select 0.005" (assuming you are trying to get the closest matching size +/- 0.0005").

Cheers, Wayne
 

gar

Senior Member
Location
Ann Arbor, Michigan
Occupation
EE
171120-1537 EST

Besoeker:

There are many electricians that are involved in equipment that has problems of this type. It does not directly relate to NEC aspects, but it is something some electricians encounter, and it is a way to get individuals to think about problems.


wwhitney:

If you have a digital instrument that has a resolution of 0.001", then it likely will also have a spec of +/-1 digit or count, which in this case is +/-0.001". An instrument with this basic resolution will not be designed to have an internal resolution 10 times better unless there is internal processing for some other reason.

.
 

Besoeker

Senior Member
Location
UK
171120-1537 EST

Besoeker:

There are many electricians that are involved in equipment that has problems of this type. It does not directly relate to NEC aspects, but it is something some electricians encounter, and it is a way to get individuals to think about problems.

I'm sure you are right. It just isn't something I recall coming across in the electrical field. If I measured our domestic supply voltage, nominally 230Vac, I might get about 242V on my Fluke. It wouldn't greatly concern me if it was 241.6V or 242.4V nor would it greatly matter. For common or garden resistors we used 5% tolerance carbon film. Electrolytic capacitors as used on the DC link of a VFD or ISK drive had quite a high tolerance on the plus side, maybe 20% from memory, same with most components. There were a few that needed closer tolerance like for analogue speed references but stability was more important like a low temperature coefficient.

I used to mess about with cars a bit and there was a need for more precise measurements there - spark plug gaps, the shims for the valve caps on my overhead cam followers. I had, probably still have, a set of shims in my toolbox and a vernier gauge. They haven't seen the light of day for at least a decade.
 

gar

Senior Member
Location
Ann Arbor, Michigan
Occupation
EE
171121-0952 EST

retirede:

In your post #16 you mentioned that Visual Basic added 5 and then truncated. That is what I described in post #15.

What do you mean by "true rounding function"? To me a rounding function is a function that takes some range of values and assigns to anything in that range a value that is of lesser resolution than the values in said range.

A bias can be added in this transformation to shift the range anywhere it is desired. Thus, a method that uses truncation can get the same result as a more elaborate procedure using comparisons. Addition combined with truncation is possibly faster and thus uses less computer resources.

.
 

retirede

Senior Member
Location
Illinois
171121-0952 EST

retirede:

In your post #16 you mentioned that Visual Basic added 5 and then truncated. That is what I described in post #15.

What do you mean by "true rounding function"? To me a rounding function is a function that takes some range of values and assigns to anything in that range a value that is of lesser resolution than the values in said range.

A bias can be added in this transformation to shift the range anywhere it is desired. Thus, a method that uses truncation can get the same result as a more elaborate procedure using comparisons. Addition combined with truncation is possibly faster and thus uses less computer resources.

.

By true rounding, I mean an operator that would result in (for example) 1.44 being rounded to 1.4 and 1.45 being rounded to 1.5 without any additional manipulation such as adding an offset.
 

MAC702

Senior Member
Location
Clark County, NV
Sometimes it matters- financial transactions for one. Accounts only keep dollars and cents, so you want to avoid any bias created by rounding the tenths of cents.

If that matters, they shouldn't round. You know, like the secrecy of the 9/10-cent gas prices. It's only rounded at the final total, and this is at least a weekly transaction for most people in the country, so the concept is already well established.

A tenth of a cent only really matters if you are paying cash, too.

So we have both debates about tenths of cents, and other debates about eliminating pennies and rounding to nickels. Hard to believe both can have valid arguments.
 

gar

Senior Member
Location
Ann Arbor, Michigan
Occupation
EE
171125-1233 EST

If I have a black box, meaning I don't know what is inside the box, called a "rounder" that receives an input number and applies a defined functional transformation between input and output to produce a "rounded" number at the output, then does what goes on inside the black box have anything to do with whether you call this "true rounding" or not?

.
 

Besoeker

Senior Member
Location
UK
I say no, but then, I also still say that rounding or truncating being better depends on the application.
Respectfully disagree.
What application would benefit from calculations using 3 as a value for pi ?
Which you probably already have on your calculator or iPhone anyway.
 

MAC702

Senior Member
Location
Clark County, NV
Respectfully disagree.
What application would benefit from calculations using 3 as a value for pi ?
Which you probably already have on your calculator or iPhone anyway.

I don't see how your question relates. Truncating or rounding is an independent issue from the resolution of doing either. Neither implies always going to a whole number, which would be arbitrary depending on the units used.

Pi is not a measurement, but a fixed ratio, whose full resolution (to the limit of the calculator, or at least several places of greater resolution than any of the measurements) would be used until the final result is achieved (which is then rounded or truncated, depending on the application).
 

Besoeker

Senior Member
Location
UK
I don't see how your question relates. Truncating or rounding is an independent issue from the resolution of doing either. Neither implies always going to a whole number, which would be arbitrary depending on the units used.

Pi is not a measurement, but a fixed ratio, whose full resolution (to the limit of the calculator, or at least several places of greater resolution than any of the measurements) would be used until the final result is achieved (which is then rounded or truncated, depending on the application).

It was a simple example to demonstrate the difference between rounding and truncating.
 

Carultch

Senior Member
Location
Massachusetts
It was a simple example to demonstrate the difference between rounding and truncating.

Rounding means that you look at the first digit you'd like to omit, and make a decision about whether it will increase the next larger digit, or leave the larger digit the way it is. If it is 0 thru 4, the previous digit remains the same. If it is 5 thru 9, the previous digit is increased. If the previous digit already is 9, then it becomes zero and the digit before that gets increased.

Truncating means you keep the quantity of digits you'd like to keep, and they ALL remain unchanged.

As an example, take Euler's number, (2.71828...), rounded and truncated to 3 significant figures, or 2 digits past the decimal. We'd like to omit the first 8, and the digits past it. 8 is greater than or equal to 5, so we rounding tells us to increase the previous digit. Truncating tells us to ignore the fact that it is an 8, and just eliminate it.
Rounded: 2.72
Truncated: 2.71
 
Status
Not open for further replies.
Top