Re: [OT] Rounding v Truncation, was: Re: Platform Support vs.

From: JF Mezei (jfmezei.spamnot_at_teksavvy.com)
Date: 07/26/05


Date: Tue, 26 Jul 2005 13:06:29 -0400

Dave Froble wrote:
> Regardless, my past experiences are that in a computer language, moving
> a real number into an integer variable causes any fractional part to be
> truncated.

Logically, I would tend to agree too.

A real number is comprised of an integer followed by decimals. When you move
it to an integer, only the integer part should be used.

truncating is a logical operation. You know exactly what you will get.

"rounding" is a subjective operation. If you have 10.4444444444444444444444444446

Is that machine going to see the 6, and then round each digit as it moves left
to come up with integer 11, or will it stop after n decimals and see only "4"
and keep the integer at 10 ?



Relevant Pages