Rename floor/1 to flooring/1

Fix for Erlang/OTP 20
This commit is contained in:
Pavel Abalikhin 2017-11-22 12:33:15 +03:00
parent bab222aeb4
commit 31e123d9f1

View file

@ -1070,7 +1070,7 @@ deregister_format(Key) ->
unixtime_to_now(T) when is_integer(T) ->
MegaSec = floor(T/1000000),
MegaSec = flooring(T/1000000),
Secs = T - MegaSec*1000000,
{MegaSec,Secs,0}.
@ -1078,10 +1078,10 @@ unixtime_to_date(T) ->
Now = unixtime_to_now(T),
calendar:now_to_datetime(Now).
floor(N) when N >= 0 ->
trunc(N);
floor(N) when N < 0 ->
Int = trunc(N),
flooring(N) when N >= 0 ->
erlang:trunc(N);
flooring(N) when N < 0 ->
Int = erlang:trunc(N),
if
Int==N -> Int;
true -> Int-1
@ -1323,7 +1323,7 @@ compressed_parser(_) ->
microsoft_parser(FloatDate) when is_float(FloatDate) ->
try
DaysSince1900 = floor(FloatDate),
DaysSince1900 = flooring(FloatDate),
Days0to1900 = calendar:date_to_gregorian_days(1900,1,1),
GregorianDays = Days0to1900 + DaysSince1900,
Date = calendar:gregorian_days_to_date(GregorianDays),