[erlang-questions] math ceil floor

Andrew Berman rexxe98@REDACTED
Fri Jun 3 03:39:18 CEST 2016


I would think the output type should be the same as the input type.  So
float in, float out.

FYI, Java takes a double and returns a double.

On Thu, Jun 2, 2016 at 3:42 PM Technion <technion@REDACTED> wrote:

> Following from other languages, C's ceil returns floats, but Ruby's ceil
> returns an Integer, PHP returns a float.
>
>
> I'm seeing here there isn't a particularly accepted standard.
> ------------------------------
> *From:* erlang-questions-bounces@REDACTED <
> erlang-questions-bounces@REDACTED> on behalf of Dan Gudmundsson <
> dangud@REDACTED>
> *Sent:* Thursday, 2 June 2016 7:56:32 PM
> *To:* Erlang Questions
> *Subject:* [erlang-questions] math ceil floor
>
> Hi
> I made pull request https://github.com/erlang/otp/pull/1084 which
> implements ceil and floor in the math module.
>
> The question is, should they return integer or floats?
>
> The implementation in the PR currently returns integers and also
> implements ceilf and floorf which returns floats.
>
> Opinions?
>
> /Dan
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160603/9f988e87/attachment.htm>


More information about the erlang-questions mailing list