ホーム
おまかせ表示
ログイン
設定
脳科学辞典について
免責事項
脳科学辞典
検索
テンプレート:Digitのソースを表示
←
テンプレート:Digit
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
<includeonly>{{digit/1|({{{1}}})|({{{2}}})|{{#if:{{{3|}}}|({{{3}}})|10}}}}</includeonly><noinclude> This template gives the digit at a given position of a given positive integer, expressed in a specified [[w:numeral system|numeral system]]. *The first parameter gives the number. *The second parameter is the position of the required digit (1 being the rightmost, 2 the one to the left, etc.). *The third parameter is the [[w:radix|radix]] of the numeral system (default:10), 2 for binary, 8 for octal, 16 for hexadecimal. For a radix > 10, the value is given in decimals, for instance, 15 in the hexadecimal system will give for the rightmost digit 15 (which should be "F") ; Usage: : {{Tlx|{{PAGENAME}}|''decimal integer''|''digit no''|''numeral system number''}} : All parameters must be positive integers. ==Examples== *{{xpsoc|digit|13|1|2}} *{{xpsoc|digit|13|2|2}} *{{xpsoc|digit|13|3|2}} *{{xpsoc|digit|13|4|2}} *{{xpsoc|digit|9002543211234567|1}} *{{xpsoc|digit|9002543211234567|2}} *{{xpsoc|digit|9002543211234567|3}} *{{xpsoc|digit|9002543211234567|4}} *{{xpsoc|digit|9002543211234567|5}} *{{xpsoc|digit|9002543211234567|6}} *{{xpsoc|digit|9002543211234567|7}} *{{xpsoc|digit|9002543211234567|8}} *{{xpsoc|digit|9002543211234567|9}} *{{xpsoc|digit|9002543211234567|10}} *{{xpsoc|digit|9002543211234567|11}} *{{xpsoc|digit|9002543211234567|12}} *{{xpsoc|digit|9002543211234567|13}} *{{xpsoc|digit|9002543211234567|14}} *{{xpsoc|digit|9002543211234567|15}} *{{xpsoc|digit|9002543211234567|16}} *{{xpsoc|digit|9002543211234567|17}} *{{xpsoc|digit|9002543211234567|18}} *{{xpsoc|digit|9002543211234567|19}} *{{xpsoc|hex|9002543211234567}} *{{xpsoc|digit|9002543211234567|1|16}} *{{xpsoc|digit|9002543211234567|2|16}} *{{xpsoc|digit|9002543211234567|3|16}} *{{xpsoc|digit|9002543211234567|4|16}} *{{xpsoc|digit|9002543211234567|5|16}} *{{xpsoc|digit|9002543211234567|6|16}} *{{xpsoc|digit|9002543211234567|7|16}} *{{xpsoc|digit|9002543211234567|8|16}} *{{xpsoc|digit|9002543211234567|9|16}} *{{xpsoc|digit|9002543211234567|10|16}} *{{xpsoc|digit|9002543211234567|11|16}} *{{xpsoc|digit|9002543211234567|12|16}} *{{xpsoc|digit|9002543211234567|13|16}} *{{xpsoc|digit|9002543211234567|14|16}} *{{xpsoc|digit|9002543211234567|15|16}} ==Large numbers of type integer== Special care has been taken to make the result exact even for large numbers of type integer. *{{xpsoc|digit|trunc(9134567890e9)+trunc123456789|1}} *{{xpsoc|#expr:trunc16*{{trunc|9002543211234567}}+trunc7}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|1}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|2}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|4}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|5}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|6}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|7}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|8}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|9}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|10}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|11}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|12}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|13}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|14}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|15}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|17}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|18}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|19}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|1|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|2|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|3|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|4|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|5|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|6|1e3}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|7|1e3}} *{{xpsoc|digit|{{int|90140406913|79753079}}|7|1e3}} *{{xpsoc|digit|{{int|90140406913|79753079}}|8|1e3}} *{{xpsoc|hex|{{int|1440406913|79753079}}}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|1|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|2|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|3|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|4|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|5|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|6|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|7|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|8|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|9|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|10|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|11|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|12|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|13|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|14|16}} *{{xpsoc|digit|{{trunc|1440406913|79753079}}|15|16}} ==Limitation== This template applies function mod with as second argument the third parameter and a power of it. Therefore it does not work properly if one of these is equal to one of the values for which mod does not work properly. Known values are 2^n-1 and 2^n+1 for n >= 32: *{{xpsoc|digit|7|1|2^32-1}} *{{xpsoc|digit|2^40|1|2^32-1}} *{{xpsoc|digit|2^40|2|2^32-1}} At least for powers with base <= 30 there are no errors with the test value 17 as first argument, see [[Help:Mod/powers]]. [[Category:Mathematical templates|{{PAGENAME}}]] </noinclude>
テンプレート:Digit
に戻る。