% coding: utf-8
-% Copyright 2008 Grégory Burri
+% Copyright 2008 Grégory Burri
%
% This file is part of Euphorik.
%
% You should have received a copy of the GNU General Public License
% along with Euphorik. If not, see <http://www.gnu.org/licenses/>.
%
-% Module avec plein de bordel utile à l'intérieur
+% Module avec plein de bordel utile à l'intérieur
% @author G.Burri
-module(euphorik_common).
--export([serialize_ip/1, unserialize_ip/1]).
+-export([\r
+ serialize_ip/1,\r
+ unserialize_ip/1,\r
+ ceiling/1\r
+]).\r
+\r
+\r
+% Arrondi un float à l'entier supérieur.\r
+% Bizarre, cette fonction n'existe pas dans la stdlib.\r
+% Pas utilisé mais bon ca me fait de la peine de l'enlever.\r
+ceiling(X) ->\r
+ T = trunc(X),\r
+ case (X - T) of\r
+ Neg when Neg < 0 -> T;\r
+ Pos when Pos > 0 -> T + 1;\r
+ _ -> T\r
+ end.
serialize_ip(undefined) ->