This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test). | |
-compile(export_all). | |
%% API | |
-compile({inline, [ insert/2 | |
, merge/2 | |
]}). | |
insert(E, []) -> [E]; | |
insert(E, [E2|_] = H) when E =< E2 -> [E, H]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test). | |
-compile(export_all). | |
%% API | |
-compile({inline, [ insert/2 | |
, merge/2 | |
]}). | |
insert(E, []) -> [E]; | |
insert(E, [E2|_] = H) when E =< E2 -> [E, H]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Power function (X ^ Y) and root function (X ^ (1/Y)) for | |
%% integers in Erlang | |
%% by Kenji Rikitake <[email protected]> 26-JAN-2010 | |
%% modified by Hynek Vychodil <[email protected]> 2-FEB-2010 | |
%% modified by Kenji Rikitake <[email protected]> 3-FEB-2010 | |
%% modified by Hynek Vychodil <[email protected]> 24-JUL-2016 | |
%% Distributed under MIT license at the end of the source code. | |
-module(bignum_root). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proplists_get_value(Key, List)-> | |
case lists:keyfind(Key,1,List) of | |
{K,V} when K =:= Key -> | |
V; | |
_-> | |
proplists_get_value_(Key, List) | |
end. | |
proplists_get_value_(_,[])-> | |
undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Power function (X ^ Y) and root function (X ^ (1/Y)) for | |
%% integers in Erlang | |
%% by Kenji Rikitake <[email protected]> 26-JAN-2010 | |
%% modified by Hynek Vychodil <[email protected]> 2-FEB-2010 | |
%% Distributed under MIT license at the end of the source code. | |
-module(bignum_root). | |
-export([power/2, root/2, sqrt/1]). |