Shift JIS
s 2 = { t + 63 if k is odd and 1 ≤ t ≤ 63 t + 64 if k is odd and 64 ≤ t ≤ 94 t + 158 if k is even {\displaystyle s_{2}={\begin{cases}t+63&{\mbox{if }}k{\mbox{ is odd and }}1\leq t\leq 63\\t+64&{\mbox{if }}k{\mbox{ is odd and }}64\leq t\leq 94\\t+158&{\mbox{if }}k{\mbox{ is even }}\end{cases}}}
面区点番号 m , k , t {\displaystyle m,k,t} から Shift_JISの 第1バイト s 1 {\displaystyle s_{1}} ・第2バイト s 2 {\displaystyle s_{2}} は以下の式で求められる。 ⌊ x ⌋ {\displaystyle \lfloor x\rfloor } は床関数。
s 1 = { ⌊ k + 257 2 ⌋ if m = 1 and 1 ≤ k ≤ 62 ⌊ k + 385 2 ⌋ if m = 1 and 63 ≤ k ≤ 94 ⌊ k + 479 2 ⌋ − ⌊ k 8 ⌋ × 3 if m = 2 and k = 1 , 3 , 4 , 5 , 8 , 12 , 13 , 14 , 15 ⌊ k + 411 2 ⌋ if m = 2 and 78 ≤ k ≤ 94 {\displaystyle s_{1}={\begin{cases}\left\lfloor {\frac {k+257}{2}}\right\rfloor &{\mbox{if }}m=1{\mbox{ and }}1\leq k\leq 62\\\left\lfloor {\frac {k+385}{2}}\right\rfloor &{\mbox{if }}m=1{\mbox{ and }}63\leq k\leq 94\\\left\lfloor {\frac {k+479}{2}}\right\rfloor -\left\lfloor {\frac {k}{8}}\right\rfloor \times 3&{\mbox{if }}m=2{\mbox{ and }}k=1,3,4,5,8,12,13,14,15\\\left\lfloor {\frac {k+411}{2}}\right\rfloor &{\mbox{if }}m=2{\mbox{ and }}78\leq k\leq 94\end{cases}}}