16 468
contributi
m |
(→Calcoli: Boooooh questa roba è talmente incasinata che anche spiegarla è macello) |
||
====Calcoli====
Una
▲Una operazione {{wp en|Bitwise operation#Rotate through carry|rrc}} viene eseguita sugli 8 bit che compongono i DV di {{stat|Attacco}} e {{stat|Difesa}}, sugli 8 bit che compongono i DV di {{stat|Velocità}} e {{stat|Speciali}} e sui 16 bit che compongono l'ID Allenatore.
<math display="block">y = (256 \cdot \operatorname{rrc}(
Come caso particolare, se il valore di ''y'' così calcolato è minore 10, la lunghezza di Magikarp diventa <math display="inline">190 + y</math>. Altrimenti, quando ''y'' ≥ 10, il valore viene utilizzato per calcolare ''x<sub>0</sub>'', ''y<sub>0</sub>'' e ''m'' come indicato nella seguente tabella, che a loro volta vengono usati per calcolare le dimensioni del Pokémon.
▲<math display="block">y = (256 \cdot \operatorname{rrc}(IV_1) + \operatorname{rrc}(IV_2)) \oplus \operatorname{rrc}(ID)</math>
{| class="std-table" style="padding: 0.5ex; {{#invoke: css | horizGrad | type = johto}}"
|-
! style="padding: 0 1ex;" | y (minore di):
! style="padding: 0 1ex;" | 0
|- ▼
! style="
! style="padding: 0 1ex;" | 512
! style="padding: 0 1ex;" | 2560
! style="padding: 0 1ex;" | 7680
! style="padding: 0 1ex;" | 17664
! style="padding: 0 1ex;" | 32512
! style="padding: 0 1ex;" | 47616
! style="padding: 0 1ex;" | 57600
! style="padding: 0 1ex;" | 62464
! style="padding: 0 1ex;" | 64512
! style="padding: 0 1ex;" | 65024
! style="padding: 0 1ex;" | 65280
! style="padding: 0 1ex;" | 65280
! x<sub>0</sub>
| 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12 || 13 || 14 || 15
|-
!
| 110 || 310 || 710 || 2710 || 7710 || 17710 || 32710 || 47710 || 57710 || 62710 || 64710 || 65210 || 65410 || 65510
|-
! m
| 1 || 2 || 4 || 20 || 50 || 100 || 150 || 150 || 100 || 50 || 20 || 5 || 2 || 1
|}
I valori in questa tabella definiscono una {{wp en|Piecewise linear function|approsimazione lineare a segmenti}} della funzione inversa della {{wp|funzione di ripartizione}} di una {{wp|distribuzione normale}} con media 800 e deviazione standard 179.
In teoria, questo dovrebbe produrre una distribuzione di probabilità normale sulle lunghezze di Magikarp. Tuttavia, il valore di ''x<sub>0</sub>'' viene calcolato come 2 più l'indice della colonna invece che 3 più l'indice della colonna, causando un errore off-by-one che cambia la media a 900.
Inoltre, la colonna selezionata sarebbe dovuta essere la prima in cui ''y'' è minore di ''y<sub>0</sub>'', ma a causa di un errore di programmazione vengono confrontati solo i byte più significativi delle due variabili, rendendo di fatto sbagliata la ricerca (questo, tra le altre cose, rende la prima e l'ultima colonna irraggiungibili).
Una volta calcolati ''x<sub>0</sub>'', ''y<sub>0</sub>'' e ''m'', la lunghezza di Magikarp in millimetri dovrebbe essere calcolata secondo la formula <math display="inline">100 \cdot x_0 + \left\lfloor (y - y_0) / m \right\rfloor</math>. Tuttavia, a causa di alcuni errori di programmazione, il calcolo non procede come previsto.
Per prima cosa, la procedura che calcola la divisione della formula assume che dividendo e divisore siano entrambi numeri a 16 bit senza segno (e quindi automaticamente positivi). In realtà però ''y'' è sempre minore di ''y<sub>0</sub>'', e che la differenza ''y - y<sub>0</sub>'' è negativa, rendendo la procedura scorretta.
Inoltre, viene letto solo il byte meno significativo del quoziente dato che chi l'ha programmato si aspettava dovesse variare solo nell'intervallo tra -1 e -100, mentre può assumere anche valori al di fuori di questo.
A causa di questi errori, la dimensione di Magikarp non segue la distribuzione normale intesa, ma calcola il valore secondo la formula:
<math display="block">\textit{
Nelle versioni in cui la lunghezza viene convertita in piedi e pollici, il risultato finale viene arrotondato per difetto al pollice più vicino.
===Terza e quarta generazione===
|