Talk:Relative errors of small EDOs: Difference between revisions
→permille vs. percent: wrong sign in permille version |
→permille vs. percent: added Python script |
||
Line 143: | Line 143: | ||
To me the percent values look more familiar and the grouping is better (at maximum pairs of numbers) --[[User:Xenwolf|Xenwolf]] ([[User talk:Xenwolf|talk]]) 19:07, 15 May 2020 (UTC) | To me the percent values look more familiar and the grouping is better (at maximum pairs of numbers) --[[User:Xenwolf|Xenwolf]] ([[User talk:Xenwolf|talk]]) 19:07, 15 May 2020 (UTC) | ||
BTW: the [[Python]] script to produce the two tables above (except for the percent and permille symbols) is as follows: | |||
<pre> | |||
import math | |||
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] | |||
def rel_err(p, edo): | |||
v = math.log(p) / math.log(2) * edo | |||
t = round(v) | |||
e = (t-v) | |||
return e | |||
def edo_primes(edo_min, edo_max, primes, unit): | |||
pot = unit[0] | |||
precision = 4-pot | |||
scale = 10 ** (pot) | |||
print('{| class="wikitable sortable mw-collapsible" style="text-align:right"') | |||
print('! rowspan="2" | Edo') | |||
print(f'! colspan="{len(primes)}" | Relative Errors (in {unit[1]})') | |||
print('|-') | |||
for p in primes: | |||
print(f'! {p:2}/1') | |||
for edo in range(edo_min, edo_max): | |||
print('|-') | |||
print(f'| {edo:2}') | |||
for p in primes: | |||
print (f'| {rel_err(p, edo)*scale:6.{precision}f}') | |||
print('|}') | |||
edo_primes(9, 15, primes[1:6], (3, 'permille')) | |||
edo_primes(9, 15, primes[1:6], (2, 'percent')) | |||
</pre> | |||
--[[User:Xenwolf|Xenwolf]] ([[User talk:Xenwolf|talk]]) 20:48, 15 May 2020 (UTC) | |||
== change from h1 to h2 headings in article body == | == change from h1 to h2 headings in article body == | ||
I plead for the restriction to h2 headings in the article body, and reserve h2 headings for the article title. If you know this great feature in Wikipedia (it's currently not provided in this Wiki but probably will in future), you will know that - as a user - you can export a very book-like presentation of a handpicked collection of articles as PDF. --[[User:Xenwolf|Xenwolf]] ([[User talk:Xenwolf|talk]]) 19:22, 15 May 2020 (UTC) | I plead for the restriction to h2 headings in the article body, and reserve h2 headings for the article title. If you know this great feature in Wikipedia (it's currently not provided in this Wiki but probably will in future), you will know that - as a user - you can export a very book-like presentation of a handpicked collection of articles as PDF. --[[User:Xenwolf|Xenwolf]] ([[User talk:Xenwolf|talk]]) 19:22, 15 May 2020 (UTC) |