Skip to content

Instantly share code, notes, and snippets.

@rramsden
Created November 11, 2011 20:12
Show Gist options
  • Save rramsden/1359090 to your computer and use it in GitHub Desktop.
Save rramsden/1359090 to your computer and use it in GitHub Desktop.
-module(test).
-compile(export_all).
-define(MILLISECONDS, 1).·
-define(SECONDS, 1000*?MILLISECONDS).
-define(MINUTES, 60*?SECONDS).
start() ->
io:format("minutes is ~p~n", [?MINUTES]),
io:format("is minutes an interger? ~p~n", [is_integer(?MINUTES)]),
io:format("(100*250)/~p = ~p~n", [?MINUTES, (100*250) / ?MINUTES] ),
io:format("(100*250)/~p = ~p~n", [60000, (100*250) / 60000] ).
2> test:start().
minutes is 60000
is minutes an interger? true
(100*250)/60000 = 416666.6666666667
(100*250)/60000 = 0.4166666666666667
ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment