Template:Order of magnitude: Difference between revisions
- Acèh
- Afrikaans
- Alemannisch
- العربية
- অসমীয়া
- Авар
- Azərbaycanca
- تۆرکجه
- Basa Bali
- বাংলা
- Banjar
- 閩南語 / Bân-lâm-gú
- Basa Banyumasan
- Беларуская (тарашкевіца)
- भोजपुरी
- Български
- Boarisch
- Bosanski
- Brezhoneg
- Català
- Cebuano
- Chamoru
- Chavacano de Zamboanga
- ChiShona
- Cymraeg
- Dansk
- الدارجة
- ދިވެހިބަސް
- डोटेली
- Eesti
- Ελληνικά
- Euskara
- فارسی
- Fiji Hindi
- Føroyskt
- Français
- Gaeilge
- Galego
- ગુજરાતી
- 客家語 / Hak-kâ-ngî
- 한국어
- Հայերեն
- हिन्दी
- Ilokano
- Bahasa Indonesia
- IsiXhosa
- IsiZulu
- Íslenska
- עברית
- Jawa
- ಕನ್ನಡ
- ქართული
- Қазақша
- Kiswahili
- Kongo
- Kurdî
- Кыргызча
- Latviešu
- Lëtzebuergesch
- Lietuvių
- Luganda
- Magyar
- Madhurâ
- मैथिली
- Македонски
- മലയാളം
- Māori
- मराठी
- مصرى
- ဘာသာမန်
- مازِرونی
- Bahasa Melayu
- Minangkabau
- 閩東語 / Mìng-dĕ̤ng-ngṳ̄
- Монгол
- မြန်မာဘာသာ
- Nederlands
- नेपाली
- नेपाल भाषा
- 日本語
- Norfuk / Pitkern
- Norsk bokmål
- ଓଡ଼ିଆ
- Oʻzbekcha / ўзбекча
- ਪੰਜਾਬੀ
- Pangasinan
- پنجابی
- ပအိုဝ်ႏဘာႏသာႏ
- Papiamentu
- پښتو
- ភាសាខ្មែរ
- Português
- Русский
- संस्कृतम्
- Scots
- Shqip
- සිංහල
- Simple English
- سنڌي
- Slovenčina
- Slovenščina
- کوردی
- Српски / srpski
- Srpskohrvatski / српскохрватски
- Sunda
- Suomi
- Svenska
- Tagalog
- தமிழ்
- Татарча / tatarça
- တႆး
- తెలుగు
- ไทย
- Тоҷикӣ
- Tsetsêhestâhese
- Türkçe
- Українська
- اردو
- Tiếng Việt
- Winaray
- ייִדיש
- Yorùbá
- 粵語
- Zazaki
- 中文
- Batak Toba
- Kumoring
Revision as of 07:39, 10 March 2025
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.
Usage
This template calculates the (decimal) order of magnitude of numbers within the ranges 10300 to 10−300 and −10−300 to −10300.
The acceptable input and the output produced are optimised for use in other templates.
- The hyphen (not a true minus sign) is used for negative numbers.
- No separator is used for thousands.
- The template gives 0 for 0. Although, strictly speaking, this is mathematically incorrect it has been designed this way so as to be more useful in other templates. An important example of this is that when used by {{convert }} 0 °C or 0 °F is considered to be on the same order of magnitude as ±1 °C or ±1 °F respectively.
Examples
{{Order of magnitude|123400}}
→ 5{{Order of magnitude|12340}}
→ 4{{Order of magnitude|1234}}
→ 3{{Order of magnitude|123.4}}
→ 2{{Order of magnitude|12.34}}
→ 1{{Order of magnitude|1.234}}
→ 0{{Order of magnitude|.1234}}
→ -1{{Order of magnitude|.01234}}
→ -2{{Order of magnitude|0}}
→ 0{{Order of magnitude}}
→ 0
Incorrect usage
The input must be an unformatted number, or the template will emit errors:
{{Order of magnitude|}}
→ Expression error: Unexpected = operator{{Order of magnitude|123,400}}
→ Expression error: Unrecognised punctuation character ","{{Order of magnitude|foo}}
→ Expression error: Unrecognised word "foo"
Technical points
This template calculates the order of magnitude of a number, using the natural logarithm of the absolute value of the number, divided by the log of 10. The amount is adjusted for truncation error in the digital format, and the floor number of the results is used. The magnitude of fractions, such as 0+1/1000 (-3), will also be calculated. The code uses four expansion-depth levels.
Template data
TemplateData for Order of magnitude
This template calculates the order of magnitude of numbers within the ranges 10^300 to 10^−300 and −10^−300 to −10^300.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Number | 1 | The number to find the order of magnitude of | Number | required |
See also
- {{Orders of magnitude }}
- {{Fractions }}
- {{Fractions and ratios }}
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.