[AccessD] roundup - decimal places

Henry Simpson hsimpson88 at hotmail.com
Tue Apr 8 10:09:22 CDT 2003


Pedro:

You are thinking in base 10 so perhaps an example in base 10 will help.  
What is the value of 1/3 in base ten to one decimal place and how close is 
that to the actual value of 1/3.  In base 3 it is an exact value but in base 
10, it is an approximation.  Fractional numbers in Base 2 also are a mere 
approximation of base 10 numbers.  There are numbers like .5, .75, .125, 
.375 that are exact number in both base systems, but numbers like .1 can not 
be exactly represented as they have an infinite number of decimal places in 
base 2 just as 1/3 has an infinite number of decimal places in base 10.

Hen




>From: "Pedro Janssen" <pedro at plex.nl>
>Reply-To: accessd at databaseadvisors.com
>To: <accessd at databaseadvisors.com>
>Subject: Re: [AccessD] roundup - decimal places
>Date: Tue, 8 Apr 2003 13:16:21 +0200
>
>Hello Charles,
>
>I use single as datatyping.
>Here are a few values that i received as result:
>
>2,199998
>0,2000008
>0,2999992
>3,799999
>-1,430511E-06
>1,519918E-06
>-1,937151E-07
>
>this result i received from numbers that were entered directly in the
>Table.(see first mail)
>
>I don't know what hardware specifications you need, but its a laptop
>Acer Travelmate 620, Pentium III, CPU1000MHz
>535MHz and 248MB RAM, WindowsXP, Home edition
>
>Pedro Janssen
>
>
>
>
>----- Original Message -----
>From: "Wortz, Charles" <CWortz at tea.state.tx.us>
>To: <accessd at databaseadvisors.com>
>Sent: Monday, April 07, 2003 8:03 PM
>Subject: RE: [AccessD] roundup - decimal places
>
>
> > Pedro,
> >
> > Are you datatyping your numbers as Single or Double?  Even with Single
> > you get approximately seven (7) digits of precision.  Thus your 5,1 will
> > be stored as some value between 5,000005 and 5,100005.  The value you
> > claim is far outside of this range, leading me to conclude it is a
> > calculated value, not a value you entered directly.  If it is a value
> > you entered directly, then please inform us of the hardware
> > specifications of your computer since it does not meet any of the
> > worldwide specifications for handling floating point numbers.
> > Charles Wortz
> > Software Development Division
> > Texas Education Agency
> > 1701 N. Congress Ave
> > Austin, TX 78701-1494
> > 512-463-9493
> > CWortz at tea.state.tx.us
> > -----Original Message-----
> > From: Charlotte Foust [mailto:cfoust at infostatsystems.com]
> > Sent: Monday 2003 Apr 07 12:42
> > To: accessd at databaseadvisors.com
> > Subject: RE: [AccessD] roundup - decimal places
> >
> >
> > You're going to have to explain whether you want to truly round numbers
> > or just display them that way.  The Decimal places setting addresses the
> > display, not the precision.
> >
> > Charlotte Foust
> > -----Original Message-----
> > From: Pedro Janssen [mailto:pedro at plex.nl]
> > Sent: Monday, April 07, 2003 9:25 AM
> > To: accessd at databaseadvisors.com
> > Subject: Re: [AccessD] roundup - decimal places
> >
> >
> > Hello Charles,
> >
> > when i type 5,1 i type 5,1 and not .
> > How does a computer changes 5,1 into 5,11415899 although i type 5,1.
> >
> > What is the use of decimal places:1, with field size: single, when the
> > pc makes a lott of decimal places from it. Then this property better
> > wasn't available when using numbers (not currency).
> > Is there a way to roundup the numbers to 1decimal place without using
> > currency.
> >
> > Pedro Janssen
> > ----- Original Message -----
> > From: Wortz, Charles
> > To: accessd at databaseadvisors.com
> > Sent: Monday, April 07, 2003 5:42 PM
> > Subject: RE: [AccessD] roundup - decimal places
> >
> >
> > Pedro,
> >
> > Remember, you are working on a binary computer.  Thus decimal numbers
> > must be approximated as the sum of powers of two.  For integer numbers
> > these approximations are exact representations.  For floating point
> > numbers, these approximations are just that - approximations.  None of
> > your floating point numbers are stored with just one digit to the right
> > of the decimal point, they are only displayed to you as such.
> >
> > If you cannot learn to live with floating point numbers, then convert
> > them to the currency datatype.  The currency datatype will meet many of
> > you computational needs.
> >
> >
> > Charles Wortz
> > -----Original Message-----
> > From: Pedro Janssen [mailto:pedro at plex.nl]
> > Sent: Monday 2003 Apr 07 10:30
> > To: AccessD at databaseadvisors.com
> > Subject: [AccessD] roundup - decimal places
> >
> >
> > Hello Group,
> >
> > i have a tableA with 5 fields (field size: single, decimal places:1)
> > Not all fields have values.
> > I want the difference from al those field, so i added a field diff.
> > I made an update query with the following sql:
> >
> > UPDATE TableA SET TableA.[diff] = 100-Nz([field1],0)-Nz([[field2],0)-
> > etc. etc.;
> >
> > The result that i get in field diff gives many records with more then 1
> > decimal places.
> >
> > For example: When i have a record which contains values like 5,1 and
> > 94,9 (all values are typed in this way and are not calculated) i get as
> > result 0,11176548
> > or a record that contains values like 20,5 and 20,5 i get as result
> > 59,997854.
> > Some result do have only one decimal place.
> >
> > How is this possible?
> >
> > TIA
> >
> > Pedro Janssen

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=features/junkmail



More information about the AccessD mailing list