1. natural?

What does the word "natural" mean in function parameters?

useless

new topic     » topic index » view message » categorize

2. Re: natural?

eukat said...

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: natural?

useless_ said...

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

new topic     » goto parent     » topic index » view message » categorize

4. On the creation of a new nonnegative and unnatural integer type.

mattlewis said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: natural?

useless_ said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu