Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Rounding
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Rounding to a specified multiple=== The most common type of rounding is to round to an integer; or, more generally, to an integer multiple of some increment β such as rounding to whole tenths of seconds, hundredths of a dollar, to whole multiples of 1/2 or 1/8β―inch, to whole dozens or thousands, etc. In general, rounding a number {{mvar|x}} to a multiple of some specified positive value {{mvar|m}} entails the following steps: :<math>\mathrm{roundToMultiple}(x, m) = \mathrm{round}(x/m) \times m</math> For example, rounding {{math|1=''x'' = 2.1784}} dollars to whole cents (i.e., to a multiple of 0.01) entails computing {{math|1=2.1784 / 0.01 = 217.84}}, then rounding that to 218, and finally computing {{math|1=218 Γ 0.01 = 2.18}}. When rounding to a predetermined number of [[significant figures|significant digits]], the increment {{mvar|m}} depends on the magnitude of the number to be rounded (or of the rounded result). The increment {{mvar|m}} is normally a finite fraction in whatever [[numeral system]] is used to represent the numbers. For display to humans, that usually means the [[decimal|decimal numeral system]] (that is, {{mvar|m}} is an integer times a [[power (mathematics)|power]] of 10, like 1/1000 or 25/100). For intermediate values stored in digital computers, it often means the [[binary number|binary numeral system]] ({{mvar|m}} is an integer times a power of 2). The abstract single-argument "round()" function that returns an integer from an arbitrary real value has at least a dozen distinct concrete definitions presented in the [[#Rounding to integer|rounding to integer]] section. The abstract two-argument "roundToMultiple()" function is formally defined here, but in many cases it is used with the implicit value {{math|1=''m'' = 1}} for the increment and then reduces to the equivalent abstract single-argument function, with also the same dozen distinct concrete definitions.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Rounding
(section)
Add topic