The argument to include it is discovery. I use to search the Reference module given by `IEx.Helpers.i/1` when I need a function related to some data, and I had hard times trying to a function to convert a `Float` to an `Integer`.I know `Kernel.round/1` rounds to the nearest integer, but the `Kernel` module didn't even come to my mind, I found this in a blog post.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/00c5e472-a5cc-4000-8a0a-a55f4fcc1316%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> Let's start by improving the docs in the Float module.That should work very well indeed. But I still feel a `to_integer` function would be easier to find.> We can start with a short explanation on floating point arithmetic and in another section include a list of functions that work with floats in Kernel, such as round/1 and trunc/1I'll open a PR for it. ;)> It is worth noting those functions are also guard allowedYep, I’ve noticed that. Is this the argument to have them as Kernel functions? Why not having a `Float.to_integer(float, :round | :trunc)` inlined by the compiler and guard allowed too?Best,Kelvin StinghenOn Jan 3, 2018, at 10:04, José Valim <jose....@gmail.com> wrote:Let's start by improving the docs in the Float module.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/E3F2372E-C4C9-4D3A-BF0C-FA07284DC708%40gmail.com.
> Yep, I’ve noticed that. Is this the argument to have them as Kernel functions? Why not having a `Float.to_integer(float, :round | :trunc)` inlined by the compiler and guard allowed too?Yeah, since they work on guards, they are in Kernel. And we decided (quite some time ago) to not duplicate the Kernel functions in specific modules.
On Wed, Jan 3, 2018 at 1:28 PM, Kelvin Raffael Stinghen <kelvin....@gmail.com> wrote:
> Let's start by improving the docs in the Float module.That should work very well indeed. But I still feel a `to_integer` function would be easier to find.> We can start with a short explanation on floating point arithmetic and in another section include a list of functions that work with floats in Kernel, such as round/1 and trunc/1I'll open a PR for it. ;)> It is worth noting those functions are also guard allowedYep, I’ve noticed that. Is this the argument to have them as Kernel functions? Why not having a `Float.to_integer(float, :round | :trunc)` inlined by the compiler and guard allowed too?Best,Kelvin StinghenOn Jan 3, 2018, at 10:04, José Valim <jose....@gmail.com> wrote:Let's start by improving the docs in the Float module.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.