タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

Erlangに関するhisabohのブックマーク (2)

  • Index - Erlang/OTP

    fact(0) -> 1; %% Pattern matching for control-flow fact(N) -> N * fact(N-1). %% Recursion to create loops > example:fact(10). %% Interactive shell for fast iterations 3628800 > [{I, example:fact(I)} || I <- lists:seq(1,10)]. [{1, 1}, {2, 2}, {3, 6}, {4, 24}, {5, 120}, {6, 720}, {7, 5040}, {8, 40320}, {9, 362880}, {10, 3628800}] > Fruits = ["banana","monkey","jungle"]. %% Immutable variables ["bana

    Index - Erlang/OTP
  • Erlang クエックブック

    文字列 文字列を数値に変換する list_to_integer("123"). % 123 list_to_integer("-10"). % -10 n進数の文字列を数値に変換する u は指定した基数で変換、# は文字列が表現している基数で変換します。 io_lib:fread("~16u", "100"). % {ok,[256],[]} io_lib:fread("~2u", "100abc"). % {ok,[4],[abc]} io_lib:fread("~36u", "100%%%"). % {ok,[1296],"%%%"} io_lib:fread("~#", "16#100"). % {ok,[256],[]} io_lib:fread("~#", "2#100abc"). % {ok,[4],[abc]} io_lib:fread("~#", "36#100%%%").

  • 1