Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



How to correct Rounding Errors in Floating Point Arithmetic?

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 11-03-2010
Member
 
Join Date: May 2009
Posts: 459
How to correct Rounding Errors in Floating Point Arithmetic?

Hello friends,
I am doing some arithmetic functions in an Excel and also facing some issues. Since I am not that much good enough, I am not able to fix the problems that I am facing. Actually I am not able to correct rounding errors in floating point. I have tried a lot of different things, but not getting the proper results. So please tell me how to correct rounding errors in floating point arithmetic..?? Thanks in Advance.!!
Reply With Quote
  #2  
Old 11-03-2010
Glenny's Avatar
Member
 
Join Date: May 2008
Posts: 4,550
Re: How to correct Rounding Errors in Floating Point Arithmetic?

I would like to explain exactly what is the main reason for the incorrect results. Many combinations of arithmetic operations on floating point numbers in Microsoft Excel and Microsoft Works can produce results that appear to be incorrect by very small amounts. For example, the equation :
  • = 1 * (.5 -. 4-.1)
can evaluate the quantity (- 2.78E - 17), or-0.0000000000000000278 instead of 0.
Reply With Quote
  #3  
Old 11-03-2010
ThoMas321's Avatar
Member
 
Join Date: Apr 2008
Posts: 4,078
Re: How to correct Rounding Errors in Floating Point Arithmetic?

This behavior is not a problem or a limitation of Excel or Works; this behavior occurs because the 754 floating point standard Institute of Electrical and Electronics Engineers (IEEE) requires that the numbers are stored in binary format. Microsoft Excel was designed around the IEEE 754 specification with respect to storing and calculating floating-point numbers. The IEEE 754 is a method of storing floating point numbers in compact form, which is easy to manipulate. This standard uses Intel coprocessors and most PC based programs that implement floating point mathematics.
__________________
Ram requirement for various OS
Reply With Quote
  #4  
Old 11-03-2010
chroma's Avatar
Member
 
Join Date: Apr 2008
Posts: 2,144
Re: How to correct Rounding Errors in Floating Point Arithmetic?

To minimize the effects of inaccuracy of floating point arithmetic storage, use the Round () function to round numbers to the number of decimal places is required for calculation. For example, when working with currency, you should probably round off to two decimal places :
Code:
= ROUND (1 * (0.5-0.4-0.1), 2)
Reply With Quote
  #5  
Old 11-03-2010
Raine's Avatar
Member
 
Join Date: May 2008
Posts: 3,287
Re: How to correct Rounding Errors in Floating Point Arithmetic?

You can often avoid errors affecting their work using the display precision floating point rounding option. This option causes the value of each number in the spreadsheet that the precision displayed in the spreadsheet. To use the precision option screen, follow these steps :
  1. On the Tools menu, click Options.
  2. In the calculation sheet in Workbook options, click to select the check box screen accuracy.
  3. Click OK.
Reply With Quote
  #6  
Old 11-03-2010
Sam.D's Avatar
Member
 
Join Date: Jan 2008
Posts: 3,735
Re: How to correct Rounding Errors in Floating Point Arithmetic?

The steps for the precision option, that is provided by 'Raine' would be useful for Excel 2003. If you are having Excel 2007, then follow the steps mentioned below :
  1. Click the Microsoft Office Button, Excel Options, and click Advanced options.
  2. In calculating this workbook section, select the book you want, click the check box to establish precisely as shown and then click OK.
If you use the screen accuracy, you should format the numbers with specific number format. Using the precision option as shown can have a cumulative calculation effects that can make the data more and more inaccurate over time. Use this option only if you are sure that the sample percision maintain the accuracy of the data.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to correct Rounding Errors in Floating Point Arithmetic?"
Thread Thread Starter Forum Replies Last Post
C++ error "floating point support not loaded" addie Software Development 4 23-12-2011 07:33 PM
floating point issue.Why is it so? maria_megha Software Development 1 23-07-2011 05:00 AM
VLC 1.1.7/openSUSE 11.3 having Floating point exception problem Bryant Windows Software 6 12-07-2011 12:14 PM
Converting the floating point number to the hexadecimal on the Microsoft Excel 2010 Aag-Man Windows Software 5 11-07-2011 11:38 AM
How to convert fractional inches into rounding numbers Rock Villa Software Development 2 01-07-2009 01:54 PM


All times are GMT +5.5. The time now is 11:25 PM.