No BSD License  

Highlights from
round2even

2.5

2.5 | 2 ratings Rate this file 4 Downloads (last 30 days) File Size: 2.38 KB File ID: #6752

round2even

by Chris Larson

 

19 Jan 2005 (Updated 20 Jan 2005)

Performs round-to-even operation. This operation is more accurate than round-to-larger.

| Watch this File

File Information
Description

The round2even function performs round to even, which is different from round to larger. The return value is the number closest to the value of expression, with the appropriate number of decimal places. If expression is exactly halfway between two possible rounded values, the function returns the possible rounded value whose rightmost digit is an even number. (In a round to larger function, a number that is halfway between two possible rounded values is always rounded to the larger number.)

Note: Round to even is a statistically more accurate rounding algorithm than round to larger.

Note: Round to even is sometimes called banker's rounding.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
20 Jan 2005 Mukhtar Ullah

Nice work. Also have a look at my file ROUND2 in the file exchange that has an option to round to even by a providing a flag. Moreover it can handle matrices and N-D arrays without any loops.

05 Oct 2007 Dimitri Shvorob

No complaints about the code, but it shouldn't be in this category - would the author consider removing and reposting?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
finance Chris Larson 22 Oct 2008 07:39:52
modeling Chris Larson 22 Oct 2008 07:39:52
analysis Chris Larson 22 Oct 2008 07:39:52
round to even Chris Larson 22 Oct 2008 07:39:52
rounding Chris Larson 22 Oct 2008 07:39:52
numbers Chris Larson 22 Oct 2008 07:39:52
financial modeling Chris Larson 22 Oct 2008 07:39:52

Contact us at files@mathworks.com