[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.3 work1 Considering math.isinteger or type()
- From: Ralph Hempel <rhempel@...>
- Date: Wed, 17 Jul 2013 17:49:19 -0400
David Demelier wrote:
As we have already discussed this, some of us on the lists think that
math.isfloat is great but should also reflect the opposite as
Joseph Manning and I thought this idea great as you only need to
remember there are math.is* to check the type. So you don't need to
think which one of the function is available.
This makes the library clear and adds a symmetry to the API.
However Thijs Schreijer also thougth about the functione type() that
should returns two values like this:
type(10) -> "number", "integer"
type(10.0) -> "number", "float"
What about math.type( 10 ) -> "integer"
math.type( 10.0 ) -> "float"
math.type( "foo" ) -> string
Or just return nil for not numbers..