1. natural?
- Posted by useless_ Feb 28, 2014
- 1716 views
What does the word "natural" mean in function parameters?
useless
2. Re: natural?
- Posted by jimcbrown (admin) Feb 28, 2014
- 1759 views
What does the word "natural" mean in function parameters?
It's short for the natural numbers which we (or more accurately, Rob Craig) decided would mean the nonnegative integers.
3. Re: natural?
- Posted by mattlewis (admin) Feb 28, 2014
- 1764 views
What does the word "natural" mean in function parameters?
It's meant to be a natural number. Interestingly, I see it is defined in several places (and slightly differently) in the standard library. Those should probably be combined, although they are currently local types.
-- std/get.e type natural(integer x) return x >= 0 end type -- std/safe.e type natural(object x) if not integer(x) then return 0 end if return x >= 0 end type -- std/net/http.e type natural(integer n) return n>=0 end type
Matt
4. On the creation of a new nonnegative and unnatural integer type.
- Posted by jimcbrown (admin) Feb 28, 2014
- 1760 views
It's meant to be a natural number. Interestingly, I see it is defined in several places (and slightly differently) in the standard library. Those should probably be combined, although they are currently local types.
These types are all functionally the same - the set of nonnegative integers.
If we're going to unify these types, then maybe we should change the name of the type as well. "Natural number" is an ambiguous term (it's not clear if it should include zero, as we do, or if it should follow the traditional form of being only the positive integers). Creating a new "nonnegnative" type would be much clear IMNSHO.
5. Re: natural?
- Posted by andi49 Feb 28, 2014
- 1779 views
What does the word "natural" mean in function parameters?
useless
Hi
Natural numbers, as i know it are really easy defined. Except the 0
At the end there are positive integers. Used in every day situations (like 3 Apples, there is nothing like an -2 Apple))
You may read this:
http://de.wikipedia.org/wiki/Nat%C3%BCrliche_Zahl
German
http://en.wikipedia.org/wiki/Natural_number
English
Andreas