1Number do(
2	//doc Number isInASequenceSet Return true if receiver is in one of the Sequence sequenceSets, otherwise false.
3	isInASequenceSet := method(
4		Sequence sequenceSets foreach(set,
5			if(in(set), return true)
6		)
7		false
8	)
9
10	//doc Number constants Object containing number constants e, inf, nan and pi.
11
12	constants := Object clone do(
13		//doc Number nan Returns a infinity constant.
14		nan := 0/0
15
16		//doc Number inf Returns a not-a-number constant.
17		inf := 1/0
18
19		//doc Number e Returns the constant e.
20		e  := 2.71828182845904523536028747135266249
21
22		//doc Number pi Returns the constant pi.
23		pi := 3.14159265358979323846264338327950288
24	)
25
26	asSimpleString := method(self asString)
27
28	//doc Number toBase(base) Returns the number in another base. 42 toBase(2) -> "101010"
29	toBase := method(base, self asString toBase(base))
30
31        //doc Number toBaseWholeBytes(base) Returns the number in another base printing out entire bytes. 42 toBaseWholeBytes(2) -> "00101010"
32        toBaseWholeBytes := method(base,
33            str := self asString toBase(base)
34            byteColumns := 256 log(base) ceil
35            alignedWidth := (str size / byteColumns) ceil * byteColumns
36            str alignRight(alignedWidth, "0")
37        )
38
39	//doc Number asHex Returns the number as hex digits inside a string. 97 asHex -> "61"
40	asHex := method(toBaseWholeBytes(16))
41
42	//doc Number asBinary Returns the number as binary digits inside a string. 42 asBinary -> "101010"
43	asBinary := method(toBaseWholeBytes(2))
44
45	//doc Number asOctal Returns the number as octal digits inside a string. 436 asOctal -> "664"
46	asOctal := method(toBaseWholeBytes(8))
47
48	//doc Number combinations(size) Returns the combinations where the receiver is the number of different objects and size is the number to be arranged.
49	combinations := method(r, self factorial /(r factorial *((self - r) factorial)))
50
51	//doc Number permutations(size) Returns the permutations where the receiver is the number of different objects and size is the number to be arranged.
52	permutations := method(r, self factorial /((self - r) factorial))
53
54	//doc Number minMax(low, high) Returns a number between or equal to low and high. If the receiver is equal to or between low and high, the receiver is returned. If the receiver is less than low, low is returned. If the receiver is greater than high, high is returned.
55	minMax := method(low, high, min(high) max(low))
56
57	asJson := getSlot("asString")
58)
59