タグ

numberに関するissmのブックマーク (3)

  • The GNU MP Bignum Library

    We're are discontinuing the operation of the huge, diverse GMP test systems setup. The reason is very odd: We can no longer live in the Stockholm house where we have the computers and are therefore selling it. There is a large, insanely aggressive dog roaming the neighbourhood. The dog has a felon owner who is beyond all reason. But surely, the Swedish authorities will take care of the situation?

  • Number#toString の実装状況一覧

    各ブラウザにおける Number#toString の実装状況一覧 Firefox 2.0.0.6 -1011010.51616.536374294967306NaNundefined -36Error: illegal radix -1Error: illegal radix 0Error: illegal radix 1-36-36-24-24-10Error: illegal radix 37-36Error: illegal radix 0Error: illegal radix 0 -1Error: illegal radix -1Error: illegal radix 0Error: illegal radix 1-1-1-1-1-1Error: illegal radix 37-1Error: illegal radix 0Error: illegal radix 0 -0

  • JavaScript で n 進数を扱う: Days on the Moon

    2 進数や 16 進数を使いたいというとき、JavaScript では組み込みの機能を利用できます。使えるのは 16 進数だけではなく、2 進数から 36 進数 (0 ~ 9 および a ~ z を使用) まで扱えます。 n 進数文字列から数値への変換 n 進数文字列から数値へと変換するときは、parseInt 関数を使います。第 2 引数に基数 n を指定することで、第 1 引数の文字列を n 進数であると解釈してくれます。n は 32 ビット整数に変換され、その値が 2 未満または 36 を超えるときは NaN が返ります。ただし、n が 0 になるときは文字列が 10 進数表記であるとして解釈されます。 parseInt(10, 36); // 36 parseInt("10", 0x100000000 + 36); // 36 基数が明示されておらず、文字列が 0 から始まっていた

  • 1