Integer:

Filter: Source: Integer.sc

A 32 bit integer. Integer inherits most of its behaviour from its superclass.

NOTE: A 32 bit signed integer can represent values in the range -2147483648 to 2147483647. Adding up further returns in a wrapped result, so that and 2147483647+1= -2147483648. For a larger range, one can use Float, which is 64 bit and supports many (but not all) numerical methods that int does.

Executes **function** for all integers from zero to this minus one.

function |
a Function which is passed two arguments, both of which are the same integer from zero to this minus one. The reason two arguments are passed is for symmetry with the implementations of do in Collection. |

Executes **function** for all integers from this minus one to zero.

Executes **function** for all integers from this to **endval**, inclusive.

endval |
an Integer. |

function |
a Function which is passed two arguments, the first which is an integer from this to endval, and the second which is a number from zero to the number of iterations minus one. |

Executes **function** for all integers from this to **endval**, inclusive, stepping each time by **stepval**.

endval |
an Integer. |

stepval |
an Integer. |

function |
a Function which is passed two arguments, the first which is an integer from this to endval, and the second which is a number from zero to the number of iterations minus one. |

an Array of this size filled by objects generated from evaluating the **function**.

a Collection of **class** of this size filled by objects generated from evaluating the **function**.

an Interval from this to **hi**.

an array with a geometric series of this size from start.

an array with a fibonacci series of this size beginning with **a** and **b**.

the prime factors as array.

See also: Randomness

exclude |
an Integer. |

a random value from zero to this, excluding the value exclude.

exclude |
an Integer. |

a random value from this.neg to this, excluding the value exclude.

a Char which has the ASCII value of the receiver.

a Char which represents the receiver as an ASCII digit.

For example `5.asDigit`

returns `$5`

.

an array with the binary digits (integer 0 or 1).

an array with the n-ary digits.

See also the complementary method SequenceableCollection: -convertDigits.

a string with the binary digits (0 or 1).

a string with the hexadecimal digits (integer 0 to F).

a string in IP format.

Interpret this as index into a scale with a given number of steps per ocatve.

the gray code for the number.

set nth bit to zero (bool = false) or one (bool = true)

`{ _CLZ }`

`{ _CTZ }`

number of required bits

true if dividable by 2 with no rest

true if not dividable by 2 with no rest

the next power of two greater than or equal to the receiver.

the whether the receiver is a power of two.

the nth prime number. The receiver must be from 0 to 6541.

the next prime less than or equal to the receiver up to 65521.

the next prime less than or equal to the receiver up to 65521.

whether the receiver is prime.

the index of a prime number less than or equal to the receiver up to 65521. If the receiver is not a prime, the answer is nil.

the factorial of the receiver as an integer. This will overflow for numbers `> 12`

and throw an error. Floating point factorials can be used in such cases (see: SimpleNumber: -factorial).

a Boolean for whether or not the specified pid is running.

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asBus.sc

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asGroup.sc

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asTarget.sc

From extension in /usr/local/share/SuperCollider/Extensions/SC3plugins/LoopBufUGens/classes/LJP Classes/Extensions/Integer-asPaddedString.sc

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asTarget.sc

helpfile source: /usr/local/share/SuperCollider/HelpSource/Classes/Integer.schelp

link::Classes/Integer::

link::Classes/Integer::