Native integer numbers.

Correspond to C int.

Introduced properties

intern fun %(i: Int): Int

core :: Int :: %

Modulo of self with i.
intern fun &(i: Int): Int

core :: Int :: &

Returns the result of a binary AND operation on self and i
fun **(e: Int): Int

core :: Int :: **

Returns the self raised to the power of e.
intern fun <<(i: Int): Int

core :: Int :: <<

i bits shift fo the left
intern fun >>(i: Int): Int

core :: Int :: >>

i bits shift fo the right
fun ^(i: Int): Int

core :: Int :: ^

Returns the result of a binary XOR operation on self and i
fun abs: Int

core :: Int :: abs

The absolute value of self
fun bits: Array[Int]

core :: Int :: bits

Give a binary representation of self Integer
intern fun code_point: Char

core :: Int :: code_point

The character which code point (unicode-wise) is self
fun delay

core :: Int :: delay

Suspend execution for self milliseconds
fun digit_count(b: Int): Int

core :: Int :: digit_count

Number of digits of an integer in base b (plus one if negative)
fun digit_count_base_10: Int

core :: Int :: digit_count_base_10

Optimized version for base 10
fun factorial: Int

core :: Int :: factorial

The factorial of self (aka self!)
fun gcd(o: Int): Int

core :: Int :: gcd

Returns the greatest common divisor of self and o
fun getbit(index: Int): Int

core :: Int :: getbit

Returns the i-bit value of self
fun highest_bit: Int

core :: Int :: highest_bit

Returns the position of the highest bit set to 1 in self
fun is_base64_char: Bool

core :: Int :: is_base64_char

Is self a valid Base64 character ?
fun is_even: Bool

core :: Int :: is_even

Is self even ?
fun is_odd: Bool

core :: Int :: is_odd

Is self odd ?
fun is_pow2: Bool

core :: Int :: is_pow2

Is self a power of two ?
fun is_prime: Bool

core :: Int :: is_prime

Is self a prime number ?
fun is_undefined: Bool

core :: Int :: is_undefined

Is this value undefined according to MPI? (may be returned by Status::count)
fun is_valid_utf8_start: Bool

core :: Int :: is_valid_utf8_start

Is self a valid UTF-8 sequence start ?
fun is_whitespace: Bool

core :: Int :: is_whitespace

Is self an ASCII whitespace ?
fun isatty: Bool

core :: Int :: isatty

Does the file descriptor self refer to a terminal?
fun number_bits(value: Int): Int

core :: Int :: number_bits

Returns the number of bits of specified value (0 or 1) in self
fun rand: Int

core :: Int :: rand

Returns a random Int in [0 .. self[.
fun rank: Rank

core :: Int :: rank

selfth MPI rank
fun setbit(index: Int, value: Int): Int

core :: Int :: setbit

Sets the i-bit of self to the given value
fun sleep

core :: Int :: sleep

Sleep approximately self seconds
fun sqrt: Int

core :: Int :: sqrt

Returns the square root of self
fun strerror: String

core :: Int :: strerror

Returns a string describing error number
fun tag: Tag

core :: Int :: tag

Tag identified by self
fun times: Range[Int]

core :: Int :: times

Returns the range from 0 to self-1.
fun to_base(base: Int): String

core :: Int :: to_base

String representation of self in the given base
fun to_base64_char: Int

core :: Int :: to_base64_char

Returns the base64 equivalent of self
fun to_bytes(n_bytes: nullable Int): Bytes

core :: Int :: to_bytes

A signed big-endian representation of self
fun to_c: Char

core :: Int :: to_c

Return the corresponding digit character
fun to_hex: String

core :: Int :: to_hex

return displayable int in hexadecimal
fun u8len: Int

core :: Int :: u8len

Gives the length of the UTF-8 char starting with self
fun unary ~: Int

core :: Int :: unary ~

Returns the 1's complement of self
intern fun |(i: Int): Int

core :: Int :: |

Returns the result of a binary OR operation on self and i

Redefined properties

redef intern fun !=(i: nullable Object): Bool

core $ Int :: !=

Have self and other different values?
redef intern fun *(i: OTHER): OTHER

core $ Int :: *

Multiplication of self with i
redef intern fun +(i: OTHER): OTHER

core $ Int :: +

Addition of self with i
redef intern fun -(i: OTHER): OTHER

core $ Int :: -

Substraction of i from self
redef intern fun /(i: OTHER): OTHER

core $ Int :: /

Division of self with i
redef intern fun <(i: OTHER): Bool

core $ Int :: <

Is self lesser than other?
redef intern fun <=(i: OTHER): Bool

core $ Int :: <=

not other < self
redef fun <=>(other: OTHER): Int

core $ Int :: <=>

-1 if <, +1 if > and 0 otherwise
redef intern fun ==(i: nullable Object): Bool

core $ Int :: ==

Have self and other the same value?
redef intern fun >(i: OTHER): Bool

core $ Int :: >

other < self
redef intern fun >=(i: OTHER): Bool

core $ Int :: >=

not self < other
redef type OTHER: Int

core $ Int :: OTHER

What self can be compared to?
redef type SELF: Int

core $ Int :: SELF

Type of this instance, automatically specialized in every class
redef fun accept_json_serializer(v: JsonSerializer)

json :: serialization_write $ Int :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
redef fun accept_msgpack_serializer(v: MsgPackSerializer)

msgpack :: serialization_write $ Int :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
redef fun add(other: Numeric): Numeric

core :: numeric $ Int :: add

Universal + with any Numeric
redef fun add_to_bundle(bundle: NativeBundle, key: JavaString)

android :: bundle $ Int :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
redef fun append_to(b: Sequence[Int])

core :: bytes $ Int :: append_to

Appends self to b
redef fun core_serialize_to(v: Serializer)

noise :: noise $ Int :: core_serialize_to

Actual serialization of self to serializer
redef fun distance(i: OTHER): Int

core $ Int :: distance

The distance between self and d.
redef fun div(other: Numeric): Numeric

core :: numeric $ Int :: div

Universal / with any Numeric
redef fun first_index_in_from(b: SequenceRead[Int], from: Int): Int

core :: bytes $ Int :: first_index_in_from

Return the first occurence of self in b starting at from, or -1 if not found
redef init from_deserializer(v: Deserializer)

noise :: noise $ Int :: from_deserializer

Create an instance of this class from the deserializer
redef fun hash: Int

core $ Int :: hash

The hash code of the object.
redef fun is_between(c: OTHER, d: OTHER): Bool

core $ Int :: is_between

c <= self <= d
redef fun is_prefix(b: SequenceRead[Int]): Bool

core :: bytes $ Int :: is_prefix

assert u'b'.is_prefix("baqsdb".to_bytes)
redef fun is_suffix(b: SequenceRead[Int]): Bool

core :: bytes $ Int :: is_suffix

assert u'b'.is_suffix("baqsdb".to_bytes)
redef fun last_index_in_from(b: SequenceRead[Int], from: Int): Int

core :: bytes $ Int :: last_index_in_from

Return the last occurence of self in b, or -1 if not found
redef fun max(other: OTHER): OTHER

core $ Int :: max

The maximum between self and other (prefers self if equals).
redef fun min(c: OTHER): OTHER

core $ Int :: min

The minimum between self and c (prefer self if equals)
redef fun mul(other: Numeric): Numeric

core :: numeric $ Int :: mul

Universal * with any Numeric
redef intern fun object_id: Int

core $ Int :: object_id

An internal hash code for the object based on its identity.
redef intern fun output

core $ Int :: output

Display self on stdout (debug only).
redef fun pattern_length: Int

core :: bytes $ Int :: pattern_length

Length of the pattern
redef fun predecessor(i: Int): OTHER

core $ Int :: predecessor

The previous element.
redef fun search_all_in(b: SequenceRead[Int]): SequenceRead[Int]

core :: bytes $ Int :: search_all_in

Returns the indexes of all the occurences of self in b
redef fun sub(other: Numeric): Numeric

core :: numeric $ Int :: sub

Universal - with any Numeric
redef fun successor(i: Int): OTHER

core $ Int :: successor

The next element.
redef intern fun to_b: Byte

core $ Int :: to_b

The byte equivalent of self
redef fun to_bi: BigInt

gmp :: gmp $ Int :: to_bi

The BigInt equivalent of self
redef intern fun to_f: Float

core $ Int :: to_f

The float equivalent of self
redef fun to_i: Int

core $ Int :: to_i

The integer part of self.
redef intern fun to_i16: Int16

core :: fixed_ints $ Int :: to_i16

The Int16 equivalent of self
redef intern fun to_i32: Int32

core :: fixed_ints $ Int :: to_i32

The Int32 equivalent of self
redef intern fun to_i8: Int8

core :: fixed_ints $ Int :: to_i8

The Int8 equivalent of self
redef fun to_jvalue(env: JniEnv): JValue

jvm :: jvm $ Int :: to_jvalue

redef fun to_r: Ratio

gmp :: gmp $ Int :: to_r

The Ratio equivalent of self
redef fun to_s: String

core :: flat $ Int :: to_s

return displayable int in base 10 and signed
redef intern fun to_u16: UInt16

core :: fixed_ints $ Int :: to_u16

The UInt16 equivalent of self
redef intern fun to_u32: UInt32

core :: fixed_ints $ Int :: to_u32

The UInt32 equivalent of self
redef intern fun unary -: OTHER

core $ Int :: unary -

Inverse of self
redef fun value_of(val: Numeric): OTHER

core $ Int :: value_of

The value of val in the domain of self
redef fun zero: OTHER

core $ Int :: zero

The value of zero in the domain of self

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
intern fun %(i: Int): Int

core :: Int :: %

Modulo of self with i.
intern fun &(i: Int): Int

core :: Int :: &

Returns the result of a binary AND operation on self and i
abstract fun *(i: OTHER): OTHER

core :: Numeric :: *

Multiplication of self with i
fun **(e: Int): Int

core :: Int :: **

Returns the self raised to the power of e.
abstract fun +(i: OTHER): OTHER

core :: Numeric :: +

Addition of self with i
abstract fun -(i: OTHER): OTHER

core :: Numeric :: -

Substraction of i from self
abstract fun /(i: OTHER): OTHER

core :: Numeric :: /

Division of self with i
abstract fun <(other: OTHER): Bool

core :: Comparable :: <

Is self lesser than other?
intern fun <<(i: Int): Int

core :: Int :: <<

i bits shift fo the left
fun <=(other: OTHER): Bool

core :: Comparable :: <=

not other < self
fun <=>(other: OTHER): Int

core :: Comparable :: <=>

-1 if <, +1 if > and 0 otherwise
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
fun >(other: OTHER): Bool

core :: Comparable :: >

other < self
fun >=(other: OTHER): Bool

core :: Comparable :: >=

not self < other
intern fun >>(i: Int): Int

core :: Int :: >>

i bits shift fo the right
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type OTHER: Comparable

core :: Comparable :: OTHER

What self can be compared to?
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun ^(i: Int): Int

core :: Int :: ^

Returns the result of a binary XOR operation on self and i
fun abs: Int

core :: Int :: abs

The absolute value of self
protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
abstract fun add(other: Numeric): Numeric

core :: Numeric :: add

Universal + with any Numeric
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
abstract fun append_to(b: Sequence[Int])

core :: BytePattern :: append_to

Appends self to b
fun bits: Array[Int]

core :: Int :: bits

Give a binary representation of self Integer
fun clamp(min: OTHER, max: OTHER): OTHER

core :: Comparable :: clamp

Constraint self within [min..max]
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
intern fun code_point: Char

core :: Int :: code_point

The character which code point (unicode-wise) is self
fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
fun delay

core :: Int :: delay

Suspend execution for self milliseconds
fun digit_count(b: Int): Int

core :: Int :: digit_count

Number of digits of an integer in base b (plus one if negative)
fun digit_count_base_10: Int

core :: Int :: digit_count_base_10

Optimized version for base 10
fun distance(d: OTHER): Int

core :: Discrete :: distance

The distance between self and d.
abstract fun div(other: Numeric): Numeric

core :: Numeric :: div

Universal / with any Numeric
fun factorial: Int

core :: Int :: factorial

The factorial of self (aka self!)
fun first_index_in(b: SequenceRead[Int]): Int

core :: BytePattern :: first_index_in

Return the first occurence of self in b, or -1 if not found
abstract fun first_index_in_from(b: SequenceRead[Int], from: Int): Int

core :: BytePattern :: first_index_in_from

Return the first occurence of self in b starting at from, or -1 if not found
init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
fun gcd(o: Int): Int

core :: Int :: gcd

Returns the greatest common divisor of self and o
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun getbit(index: Int): Int

core :: Int :: getbit

Returns the i-bit value of self
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun highest_bit: Int

core :: Int :: highest_bit

Returns the position of the highest bit set to 1 in self
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_base64_char: Bool

core :: Int :: is_base64_char

Is self a valid Base64 character ?
fun is_between(c: OTHER, d: OTHER): Bool

core :: Comparable :: is_between

c <= self <= d
fun is_even: Bool

core :: Int :: is_even

Is self even ?
fun is_odd: Bool

core :: Int :: is_odd

Is self odd ?
fun is_pow2: Bool

core :: Int :: is_pow2

Is self a power of two ?
abstract fun is_prefix(b: SequenceRead[Int]): Bool

core :: BytePattern :: is_prefix

Is self a prefix for b ?
fun is_prime: Bool

core :: Int :: is_prime

Is self a prime number ?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
abstract fun is_suffix(b: SequenceRead[Int]): Bool

core :: BytePattern :: is_suffix

Is self a suffix for b ?
fun is_undefined: Bool

core :: Int :: is_undefined

Is this value undefined according to MPI? (may be returned by Status::count)
fun is_valid_utf8_start: Bool

core :: Int :: is_valid_utf8_start

Is self a valid UTF-8 sequence start ?
fun is_whitespace: Bool

core :: Int :: is_whitespace

Is self an ASCII whitespace ?
fun is_zero: Bool

core :: Numeric :: is_zero

Is this the value of zero in its domain?
fun isatty: Bool

core :: Int :: isatty

Does the file descriptor self refer to a terminal?
fun last_index_in(b: SequenceRead[Int]): Int

core :: BytePattern :: last_index_in

Return the last occurence of self in b, or -1 if not found
abstract fun last_index_in_from(b: SequenceRead[Int], from: Int): Int

core :: BytePattern :: last_index_in_from

Return the last occurence of self in b, or -1 if not found
fun max(other: OTHER): OTHER

core :: Comparable :: max

The maximum between self and other (prefers self if equals).
fun min(c: OTHER): OTHER

core :: Comparable :: min

The minimum between self and c (prefer self if equals)
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
abstract fun mul(other: Numeric): Numeric

core :: Numeric :: mul

Universal * with any Numeric
fun number_bits(value: Int): Int

core :: Int :: number_bits

Returns the number of bits of specified value (0 or 1) in self
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
abstract fun pattern_length: Int

core :: BytePattern :: pattern_length

Length of the pattern
abstract fun predecessor(i: Int): OTHER

core :: Discrete :: predecessor

The previous element.
fun rand: Int

core :: Int :: rand

Returns a random Int in [0 .. self[.
fun rank: Rank

core :: Int :: rank

selfth MPI rank
abstract fun search_all_in(b: SequenceRead[Int]): SequenceRead[Int]

core :: BytePattern :: search_all_in

Returns the indexes of all the occurences of self in b
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
fun setbit(index: Int, value: Int): Int

core :: Int :: setbit

Sets the i-bit of self to the given value
fun sleep

core :: Int :: sleep

Sleep approximately self seconds
fun sqrt: Int

core :: Int :: sqrt

Returns the square root of self
fun strerror: String

core :: Int :: strerror

Returns a string describing error number
abstract fun sub(other: Numeric): Numeric

core :: Numeric :: sub

Universal - with any Numeric
abstract fun successor(i: Int): OTHER

core :: Discrete :: successor

The next element.
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun tag: Tag

core :: Int :: tag

Tag identified by self
fun times: Range[Int]

core :: Int :: times

Returns the range from 0 to self-1.
abstract fun to_b: Byte

core :: Numeric :: to_b

The byte equivalent of self
fun to_base(base: Int): String

core :: Int :: to_base

String representation of self in the given base
fun to_base64_char: Int

core :: Int :: to_base64_char

Returns the base64 equivalent of self
fun to_bi: BigInt

core :: Numeric :: to_bi

The BigInt equivalent of self
fun to_bytes(n_bytes: nullable Int): Bytes

core :: Int :: to_bytes

A signed big-endian representation of self
fun to_c: Char

core :: Int :: to_c

Return the corresponding digit character
abstract fun to_f: Float

core :: Numeric :: to_f

The float equivalent of self
fun to_hex: String

core :: Int :: to_hex

return displayable int in hexadecimal
abstract fun to_i: Int

core :: Numeric :: to_i

The integer part of self.
fun to_i16: Int16

core :: Numeric :: to_i16

The Int16 equivalent of self
fun to_i32: Int32

core :: Numeric :: to_i32

The Int32 equivalent of self
fun to_i8: Int8

core :: Numeric :: to_i8

The Int8 equivalent of self
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_r: Ratio

core :: Numeric :: to_r

The Ratio equivalent of self
fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun to_u16: UInt16

core :: Numeric :: to_u16

The UInt16 equivalent of self
fun to_u32: UInt32

core :: Numeric :: to_u32

The UInt32 equivalent of self
fun u8len: Int

core :: Int :: u8len

Gives the length of the UTF-8 char starting with self
abstract fun unary -: OTHER

core :: Numeric :: unary -

Inverse of self
fun unary ~: Int

core :: Int :: unary ~

Returns the 1's complement of self
abstract fun value_of(val: Numeric): OTHER

core :: Numeric :: value_of

The value of val in the domain of self
abstract fun zero: OTHER

core :: Numeric :: zero

The value of zero in the domain of self
intern fun |(i: Int): Int

core :: Int :: |

Returns the result of a binary OR operation on self and i
package_diagram core::Int Int serialization::DirectSerializable DirectSerializable core::Int->serialization::DirectSerializable core::Discrete Discrete core::Int->core::Discrete core::Numeric Numeric core::Int->core::Numeric core::BytePattern BytePattern core::Int->core::BytePattern sqlite3::Sqlite3Data Sqlite3Data core::Int->sqlite3::Sqlite3Data serialization::Serializable Serializable serialization::DirectSerializable->serialization::Serializable core::Comparable Comparable core::Discrete->core::Comparable core::Numeric->core::Comparable core::Object Object core::BytePattern->core::Object sqlite3::Sqlite3Data->core::Object ...serialization::Serializable ... ...serialization::Serializable->serialization::Serializable ...core::Comparable ... ...core::Comparable->core::Comparable ...core::Object ... ...core::Object->core::Object

Ancestors

interface Comparable

core :: Comparable

The ancestor of class where objects are in a total order.
interface Object

core :: Object

The root of the class hierarchy.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Parents

interface BytePattern

core :: BytePattern

Any kind of entity which can be searched for in a Sequence of Byte
interface DirectSerializable

serialization :: DirectSerializable

Instances of this class are not delayed and instead serialized immediately
interface Discrete

core :: Discrete

Discrete total orders.
interface Numeric

core :: Numeric

A numeric value supporting mathematical operations
interface Sqlite3Data

sqlite3 :: Sqlite3Data

A data type supported by Sqlite3

Class definitions

core $ Int
# Native integer numbers.
# Correspond to C int.
universal Int
	super Discrete
	super Numeric

	redef type OTHER: Int

	redef fun successor(i) do return self + i
	redef fun predecessor(i) do return self - i

	redef fun object_id is intern
	redef fun hash do return self
	redef fun ==(i) is intern
	redef fun !=(i) is intern
	redef fun output is intern

	redef fun <=(i) is intern
	redef fun <(i) is intern
	redef fun >=(i) is intern
	redef fun >(i) is intern
	redef fun +(i) is intern

	redef fun - is intern
	redef fun -(i) is intern
	redef fun *(i) is intern
	redef fun /(i) is intern

	# Modulo of `self` with `i`.
	#
	# Finds the remainder of division of `self` by `i`.
	#
	#     assert 5 % 2			== 1
	#     assert 10 % 2			== 0
	fun %(i: Int): Int is intern

	redef fun zero do return 0
	redef fun value_of(val) do return val.to_i

	# `i` bits shift fo the left
	#
	#     assert 5 << 1    == 10
	fun <<(i: Int): Int is intern `{ return self << i; `}

	# `i` bits shift fo the right
	#
	#     assert 5 >> 1    == 2
	fun >>(i: Int): Int is intern `{ return self >> i; `}

	redef fun to_i do return self
	redef fun to_f is intern
	redef fun to_b is intern

	redef fun distance(i)
	do
		var d = self - i
		if d >= 0 then
			return d
		else
			return -d
		end
	end

	redef fun <=>(other)
	do
		if self < other then
			return -1
		else if other < self then
			return 1
		else
			return 0
		end
	end

	redef fun is_between(c, d)
	do
		if self < c or d < self then
			return false
		else
			return true
		end
	end

	redef fun max(other)
	do
		if self < other then
			return other
		else
			return self
		end
	end

	redef fun min(c)
	do
		if c < self then
			return c
		else
			return self
		end
	end

	# The character which code point (unicode-wise) is `self`
	#
	#     assert 65.code_point == 'A'
	#     assert 10.code_point == '\n'
	#     assert 0x220B.code_point == '∋'
	fun code_point: Char is intern `{ return (uint32_t)self; `}

	# Number of digits of an integer in base `b` (plus one if negative)
	#
	#     assert 123.digit_count(10) == 3
	#     assert 123.digit_count(2) == 7 # 1111011 in binary
	fun digit_count(b: Int): Int
	do
		if b == 10 then return digit_count_base_10
		var d: Int # number of digits
		var n: Int # current number
		# Sign
		if self < 0 then
			d = 1
			n = - self
		else if self == 0 then
			return 1
		else
			d = 0
			n = self
		end
		# count digits
		while n > 0 do
			d += 1
			n = n / b	# euclidian division /
		end
		return d
	end

	# Optimized version for base 10
	fun digit_count_base_10: Int
	do
		var val: Int
		var result: Int
		if self < 0 then
			result = 2
			val = -self
		else
			result = 1
			val = self
		end
		loop
			if val < 10 then return result
			if val < 100 then return result+1
			if val < 1000 then return result+2
			if val < 10000 then return result+3
			val = val / 10000
			result += 4
		end
	end

	# Return the corresponding digit character
	# If 0 <= `self` <= 9, return the corresponding character.
	#
	#     assert 5.to_c    == '5'
	#
	# If 10 <= `self` <= 36, return the corresponding letter [a..z].
	#
	#     assert 15.to_c   == 'f'
	fun to_c: Char
	do
		assert self >= 0 and self <= 36 # TODO plan for this
		if self < 10 then
			return (self + '0'.code_point).code_point
		else
			return (self - 10 + 'a'.code_point).code_point
		end
	end

	# The absolute value of self
	#
	#     assert (-10).abs   == 10
	#     assert 10.abs    == 10
	#     assert 0.abs     == 0
	fun abs: Int do return if self >= 0 then self else -self

	# Is `self` an ASCII whitespace ?
	fun is_whitespace: Bool do return self == 0x7F or self <= 0x20
end
lib/core/kernel.nit:702,1--886,3

core :: range $ Int
redef class Int
	# Returns the range from 0 to `self-1`.
	#
	#     assert 3.times == [0..3[
	#     assert 10.times == [0..10[
	#     assert ((-1).times).is_empty
	#
	# This can be usefull for loops:
	#
	#    var s = new Array[String]
	#    for i in 3.times do s.add "cool"
	#    assert s.join(" ") == "cool cool cool"
	fun times: Range[Int] do return [0 .. self[
end
lib/core/collection/range.nit:240,1--253,3

core :: fixed_ints $ Int
redef class Int
	redef fun to_i8 is intern
	redef fun to_i16 is intern
	redef fun to_u16 is intern
	redef fun to_i32 is intern
	redef fun to_u32 is intern
end
lib/core/fixed_ints.nit:93,1--99,3

core :: math $ Int
redef class Int
	# Returns a random `Int` in `[0 .. self[`.
	fun rand: Int `{
		if (nit_rand_seeded) return (long)(((double)self)*nit_rand()/(NIT_RAND_MAX+1.0));
		return (long)(((double)self)*rand()/(RAND_MAX+1.0));
	`}

	# Returns the result of a binary AND operation on `self` and `i`
	#
	#     assert 0x10 & 0x01 == 0
	fun &(i: Int): Int is intern `{ return self & i; `}

	# Returns the result of a binary OR operation on `self` and `i`
	#
	#     assert 0x10 | 0x01 == 0x11
	fun |(i: Int): Int is intern `{ return self | i; `}

	# Returns the result of a binary XOR operation on `self` and `i`
	#
	#     assert 0x101 ^ 0x110 == 0x11
	fun ^(i: Int): Int `{ return self ^ i; `}

	# Returns the 1's complement of `self`
	#
	#     assert ~0x2F == -48
	fun ~: Int `{ return ~self; `}

	# Returns the square root of `self`
	#
	#     assert 16.sqrt == 4
	fun sqrt: Int `{ return sqrt(self); `}

	# Returns the greatest common divisor of `self` and `o`
	#
	#     assert 54.gcd(24)   == 6
	#     assert -54.gcd(-24) == 6
	#     assert 54.gcd(-24)  == -6
	#     assert -54.gcd(24)  == -6
	#     assert 12.gcd(6)    == 6
	fun gcd(o: Int): Int
	do
		if self < 0 then return -(-self).gcd(o)
		if o < 0 then return -(self.gcd(-o))
		if self == 0 or o == self then return o
		if o == 0 then return self
		if self & 1 == 0 then
			if o & 1 == 1 then
				return (self >> 1).gcd(o)
			else
				return (self >> 1).gcd(o >> 1) << 1
			end
		end
		if o & 1 == 0 then return self.gcd(o >> 1)
		if self > o then return ((self - o) >> 1).gcd(o)
		return ((o - self) >> 1).gcd(self)
	end

	# Is `self` even ?
	#
	#     assert 12.is_even
	fun is_even: Bool do return self % 2 == 0

	# Is `self` odd ?
	#
	#     assert not 13.is_even
	fun is_odd: Bool do return not is_even

	# Is self a prime number ?
	#
	#	assert 3.is_prime
	#	assert not 1.is_prime
	#	assert not 15.is_prime
	fun is_prime: Bool
	do
		if self == 2 then
			return true
		else if self <= 1 or self.is_even then
			return false
		end
		for i in [3..self.sqrt] do
			if self % i == 0 then return false
		end
		return true
	end

	# Returns the `self` raised to the power of `e`.
	#
	#     assert 2 ** 3 == 8
	fun **(e: Int): Int
	do
		return self.to_f.pow(e.to_f).to_i
	end

	# The factorial of `self` (aka `self!`)
	#
	# Returns `1 * 2 * 3 * ... * self-1 * self`
	#
	#     assert 0.factorial == 1  # by convention for an empty product
	#     assert 1.factorial == 1
	#     assert 4.factorial == 24
	#     assert 9.factorial == 362880
	fun factorial: Int
	do
		assert self >= 0
		var res = 1
		var n = self
		while n > 0 do
			res = res * n
			n -= 1
		end
		return res
	end

	# Is `self` a power of two ?
	#
	# ~~~nit
	# assert not 3.is_pow2
	# assert 2.is_pow2
	# assert 1.is_pow2
	# assert not 0.is_pow2
	# ~~~
	fun is_pow2: Bool do return self != 0 and (self & self - 1) == 0
end
lib/core/math.nit:60,1--182,3

core :: bitset $ Int
# Add support of binary operations related to binary level of Integer
# For compatibility reasons, xor, and, or methods are still in the `math` module.
redef class Int

	# Sets the i-bit of self to the given `value`
	#
	#	 assert 11.setbit(0, 0) == 10
	#	 assert 10.setbit(0, 1) == 11
	fun setbit(index: Int, value: Int): Int `{
		assert(index >= 0 && index < 32);

		if(value == 1)
			return self | (1 << index);
		else
			return self & ~(1 << index);
	`}

	# Returns the i-bit value of `self`
	#
	#	 assert 10.getbit(0) == 0
	#	 assert 10.getbit(3) == 1
	fun getbit(index: Int): Int `{
		assert(index >= 0 && index < 32);

		int op = 1 << index;

		if((self & op) == 0)
			return 0;
		else
			return 1;
	`}

	# Give a binary representation of self Integer
	fun bits: Array[Int]
	do
		var bits = new Array[Int].with_capacity(32)

		for i in [0..32[
		do
			bits[i] = getbit(i)
		end

		return bits
	end

	# Returns the number of bits of specified value (0 or 1) in `self`
	#
	#	 assert 10.number_bits(1) == 2
	#	 assert 10.number_bits(0) == 30
	fun number_bits(value: Int): Int `{
		assert(value == 0 || value == 1);

		long int bound = 1L << 31;
		int count = 0;
		long int i;

		if(value == 1)
		{
			for(i=bound; i>0; i/=2)
			{
				if(self & i)
					count++;
			}
		}
		else
		{
			for(i=bound; i>0; i/=2)
			{
				if(!(self & i))
					count++;
			}
		}
		return count;
	`}

	# Returns the position of the highest bit set to 1 in `self`
	#
	# The rightmost bit is at position 0.
	#
	#	 assert 10.highest_bit == 3
	#	 assert 1.highest_bit == 0
	fun highest_bit: Int `{
		long int msb = 1L << 31;
		int pos = 31;

		while(msb > 0 && !(self & msb))
		{
			msb /= 2;
			pos--;
		}

		return pos;
	`}
end
lib/core/bitset.nit:27,1--120,3

core :: native $ Int
redef class Int
	# Gives the length of the UTF-8 char starting with `self`
	fun u8len: Int do
		if self & 0b1000_0000 == 0 then
			return 1
		else if self & 0b1110_0000 == 0b1100_0000 then
			return 2
		else if self & 0b1111_0000 == 0b1110_0000 then
			return 3
		else if self & 0b1111_1000 == 0b1111_0000 then
			return 4
		else
			return 1
		end
	end

	# Is `self` a valid UTF-8 sequence start ?
	#
	# ~~~nit
	# assert 0.is_valid_utf8_start
	# assert 0xC0.is_valid_utf8_start
	# assert 0xE0.is_valid_utf8_start
	# assert 0xF0.is_valid_utf8_start
	# ~~~
	fun is_valid_utf8_start: Bool do
		if self & 0x80 == 0 then return true
		if self & 0b1110_0000 == 0b1100_0000 then return true
		if self & 0b1111_0000 == 0b1110_0000 then return true
		if self & 0b1111_1000 == 0b1111_0000 then return true
		return false
	end
end
lib/core/text/native.nit:38,1--69,3

core :: abstract_text $ Int
redef class Int

	# Wrapper of strerror C function
	private fun strerror_ext: CString `{ return strerror((int)self); `}

	# Returns a string describing error number
	fun strerror: String do return strerror_ext.to_s

	# Fill `s` with the digits in base `base` of `self` (and with the '-' sign if negative).
	# assume < to_c max const of char
	private fun fill_buffer(s: Buffer, base: Int)
	do
		var n: Int
		# Sign
		if self < 0 then
			n = - self
			s.chars[0] = '-'
		else if self == 0 then
			s.chars[0] = '0'
			return
		else
			n = self
		end
		# Fill digits
		var pos = digit_count(base) - 1
		while pos >= 0 and n > 0 do
			s.chars[pos] = (n % base).to_c
			n = n / base # /
			pos -= 1
		end
	end

	# C function to calculate the length of the `CString` to receive `self`
	private fun int_to_s_len: Int `{
		return snprintf(NULL, 0, "%ld", self);
	`}

	# C function to convert an nit Int to a CString (char*)
	private fun native_int_to_s(nstr: CString, strlen: Int) `{
		snprintf(nstr, strlen, "%ld", self);
	`}

	# String representation of `self` in the given `base`
	#
	# ~~~
	# assert 15.to_base(10) == "15"
	# assert 15.to_base(16) == "f"
	# assert 15.to_base(2) == "1111"
	# assert (-10).to_base(3) == "-101"
	# ~~~
	fun to_base(base: Int): String
	do
		var l = digit_count(base)
		var s = new Buffer
		s.enlarge(l)
		for x in [0..l[ do s.add(' ')
		fill_buffer(s, base)
		return s.to_s
	end


	# return displayable int in hexadecimal
	#
	# ~~~
	# assert 1.to_hex  == "1"
	# assert (-255).to_hex  == "-ff"
	# ~~~
	fun to_hex: String do return to_base(16)
end
lib/core/text/abstract_text.nit:1956,1--2024,3

core :: flat $ Int
redef class Int
	# return displayable int in base 10 and signed
	#
	#     assert 1.to_s            == "1"
	#     assert (-123).to_s       == "-123"
	redef fun to_s do
		# Fast case for common numbers
		if self == 0 then return "0"
		if self == 1 then return "1"

		var nslen = int_to_s_len
		var ns = new CString(nslen + 1)
		ns[nslen] = 0
		native_int_to_s(ns, nslen + 1)
		return new FlatString.full(ns, nslen, 0, nslen)
	end
end
lib/core/text/flat.nit:1465,1--1481,3

core :: re $ Int
redef universal Int
	private fun is_nomatch: Bool `{ return self == REG_NOMATCH; `}
end
lib/core/re.nit:99,1--101,3

core :: bytes $ Int
redef class Int
	super BytePattern

	# Write self as a string into `ns` at position `pos`
	private fun add_digest_at(ns: CString, pos: Int) do
		var tmp = (0xF0 & self) >> 4
		ns[pos] = if tmp >= 0x0A then tmp + 0x37 else tmp + 0x30
		tmp = 0x0F & self
		ns[pos + 1] = if tmp >= 0x0A then tmp + 0x37 else tmp + 0x30
	end

	# Is `self` a valid hexadecimal digit (in ASCII)
	#
	# ~~~nit
	# intrude import core::bytes
	# assert not u'/'.is_valid_hexdigit
	# assert u'0'.is_valid_hexdigit
	# assert u'9'.is_valid_hexdigit
	# assert not u':'.is_valid_hexdigit
	# assert not u'@'.is_valid_hexdigit
	# assert u'A'.is_valid_hexdigit
	# assert u'F'.is_valid_hexdigit
	# assert not u'G'.is_valid_hexdigit
	# assert not u'`'.is_valid_hexdigit
	# assert u'a'.is_valid_hexdigit
	# assert u'f'.is_valid_hexdigit
	# assert not u'g'.is_valid_hexdigit
	# ~~~
	private fun is_valid_hexdigit: Bool do
		return (self >= 0x30 and self <= 0x39) or
		       (self >= 0x41 and self <= 0x46) or
		       (self >= 0x61 and self <= 0x66)
	end

	# `self` as a hexdigit to its byte value
	#
	# ~~~nit
	# intrude import core::bytes
	# assert 0x39.hexdigit_to_byteval == 0x09
	# assert 0x43.hexdigit_to_byteval == 0x0C
	# ~~~
	#
	# REQUIRE: `self.is_valid_hexdigit`
	private fun hexdigit_to_byteval: Int do
		if self >= 0x30 and self <= 0x39 then
			return self - 0x30
		else if self >= 0x41 and self <= 0x46 then
			return self - 0x37
		else if self >= 0x61 and self <= 0x66 then
			return self - 0x57
		end
		# Happens only if the requirement is not met.
		# i.e. this abort is here to please the compiler
		abort
	end

	redef fun first_index_in_from(b, from) do
		for i in [from .. b.length[ do if b[i] == self then return i
		return -1
	end

	redef fun last_index_in_from(b, from) do
		for i in [0 .. from].step(-1) do if b[i] == self then return i
		return -1
	end

	redef fun search_all_in(b) do
		var ret = new Array[Int]
		var pos = 0
		loop
			pos = first_index_in_from(b, pos)
			if pos == -1 then return ret
			ret.add pos
			pos += 1
		end
	end

	redef fun pattern_length do return 1

	redef fun append_to(b) do b.push self

	#     assert u'b'.is_suffix("baqsdb".to_bytes)
	#     assert not u'b'.is_suffix("baqsd".to_bytes)
	redef fun is_suffix(b) do return b.length != 0 and b.last == self

	#     assert u'b'.is_prefix("baqsdb".to_bytes)
	#     assert not u'b'.is_prefix("aqsdb".to_bytes)
	redef fun is_prefix(b) do return b.length != 0 and b.first == self

	# A signed big-endian representation of `self`
	#
	# ~~~
	# assert     1.to_bytes.hexdigest ==     "01"
	# assert   255.to_bytes.hexdigest ==     "FF"
	# assert   256.to_bytes.hexdigest ==   "0100"
	# assert 65535.to_bytes.hexdigest ==   "FFFF"
	# assert 65536.to_bytes.hexdigest == "010000"
	# ~~~
	#
	# Negative values are converted to their two's complement.
	# Be careful as the result can be ambiguous.
	#
	# ~~~
	# assert     (-1).to_bytes.hexdigest ==     "FF"
	# assert    (-32).to_bytes.hexdigest ==     "E0"
	# assert   (-512).to_bytes.hexdigest ==   "FE00"
	# assert (-65794).to_bytes.hexdigest == "FEFEFE"
	# ~~~
	#
	# Optionally, set `n_bytes` to the desired number of bytes in the output.
	# This setting can disambiguate the result between positive and negative
	# integers. Be careful with this parameter as the result may overflow.
	#
	# ~~~
	# assert        1.to_bytes(2).hexdigest ==     "0001"
	# assert    65535.to_bytes(2).hexdigest ==     "FFFF"
	# assert     (-1).to_bytes(2).hexdigest ==     "FFFF"
	# assert   (-512).to_bytes(4).hexdigest == "FFFFFE00"
	# assert 0x123456.to_bytes(2).hexdigest ==     "3456"
	# ~~~
	#
	# For 0, a Bytes object with single nul byte is returned (instead of an empty Bytes object).
	#
	# ~~~
	# assert 0.to_bytes.hexdigest == "00"
	# ~~~
	#
	# For positive integers, `Bytes::to_i` can reverse the operation.
	#
	# ~~~
	# assert 1234.to_bytes.to_i == 1234
	# ~~~
	#
	# Require self >= 0
	fun to_bytes(n_bytes: nullable Int): Bytes do

		# If 0, force using at least one byte
		if self == 0 and n_bytes == null then n_bytes = 1

		# Compute the len (log256)
		var len = 1
		var max = 256
		var s = self.abs
		while s >= max do
			len += 1
			max *= 256
		end

		# Two's complement
		s = self
		if self < 0 then
			var ff = 0
			for j in [0..len[ do
				ff *= 0x100
				ff += 0xFF
			end

			s = ((-self) ^ ff) + 1
		end

		# Cut long values
		if n_bytes != null and len > n_bytes then len = n_bytes

		# Allocate the buffer
		var cap = n_bytes or else len
		var res = new Bytes.with_capacity(cap)

		var filler = if self < 0 then 0xFF else 0
		for i in [0..cap[ do res[i] = filler

		# Fill it starting with the end
		var i = cap
		var sum = s
		while i > cap - len do
			i -= 1
			res[i] = sum % 256
			sum /= 256
		end

		return res
	end
end
lib/core/bytes.nit:52,1--233,3

core :: numeric $ Int
redef universal Int
	redef fun add(other)
	do
		if other isa Float then
			return to_f + other
		else
			return self + other.as(Int)
		end
	end

	redef fun sub(other)
	do
		if other isa Float then
			return to_f - other
		else
			return self - other.as(Int)
		end
	end

	redef fun mul(other)
	do
		if other isa Float then
			return to_f * other
		else
			return self * other.as(Int)
		end
	end

	redef fun div(other)
	do
		if other isa Float then
			return to_f / other
		else if other isa Int then
			if other == 0 then return self.to_f / 0.0
			return self / other
		else abort
	end
end
lib/core/numeric.nit:85,1--122,3

core :: time $ Int
redef class Int
	# Sleep approximately `self` seconds
	#
	# Is not interrupted by signals.
	fun sleep do to_f.sleep
end
lib/core/time.nit:54,1--59,3

core :: file $ Int
redef class Int
	# Creates a file stream from a file descriptor `fd` using the file access `mode`.
	#
	# NOTE: The `mode` specified must be compatible with the one used in the file descriptor.
	private fun fd_to_stream(mode: CString): NativeFile `{
		return fdopen((int)self, mode);
	`}

	# Does the file descriptor `self` refer to a terminal?
	fun isatty: Bool `{ return isatty(self); `}
end
lib/core/file.nit:302,1--312,3

base64 :: base64 $ Int
redef class Int
	# Is `self` a valid Base64 character ?
	fun is_base64_char: Bool do
		if self == u'+' then return true
		if self == u'/' then return true
		if self > u'Z' then
			if self < u'a' then return false
			if self <= u'z' then return true
			return false
		end
		if self >= u'A' then return true
		if self <= u'9' and self >= u'0' then return true
		return false
	end

	# Returns the `base64` equivalent of `self`
	#
	# REQUIRE `self`.`is_base64_char`
	fun to_base64_char: Int do
		if self == u'+' then return 62
		if self == u'/' then return 63
		if self > u'Z' then
			if self < u'a' then abort
			if self <= u'z' then return self - 71
			abort
		end
		if self >= u'A' then return self - 0x41
		if self <= u'9' and self >= u'0' then return self + 4
		abort
	end
end
lib/base64/base64.nit:28,1--58,3

bcm2835 :: bcm2835 $ Int
redef universal Int
	fun bcm2835_delay `{ bcm2835_delay(self); `}
	fun bcm2835_delay_micros `{ bcm2835_delayMicroseconds(self); `}
end
lib/bcm2835/bcm2835.nit:121,1--124,3

binary :: binary $ Int
redef class Int
	# Utility for `BinaryWriter`
	private fun int64_byte_at(index: Int, big_endian: Bool): Int `{
		union {
			unsigned char bytes[8];
			int64_t val;
			uint64_t conv;
		} u;

		u.val = self;

		if (big_endian)
			u.conv = htobe64(u.conv);
		else u.conv = htole64(u.conv);

		return u.bytes[index];
	`}
end
lib/binary/binary.nit:342,1--359,3

crypto :: basic_ciphers $ Int
redef class Int
	# Generates the paces for each depth.
	#
	# Each entry of the returned array is a couple of the first pace
	# and the second one, they are alternated when deciphering a rail-encrypted string.
	#
	# Say we have the encrypted string "fgounbmtcieehkh" on 4 rails
	#
	# To find the distance between each character on the original railed
	# string, we need to compute the extremes.
	#
	# The extremes always have a distance of `depth - 1`, multiplied by 2, no pairing.
	#
	# In the example, that would be : [(4 - 1) * 2, (4 - 1) * 2] => [6,6]
	#
	# For every rail in-between, the first distance is the largest absolute value
	# of the difference between the current depth and the extremes, multiplied by 2.
	#
	# Its pair is the distance of maximum and the distance yielded by the previous
	# calculation.
	#
	# In our example, that would be :
	#
	# Maximums : (4 - 1) * 2 = 3 * 2 => [6,6]
	# In between : Distance for depth 2 : max(2 - 1, 4 - 2) => 2
	# The calculation yields the couple [(2 * 2), 6 - 4] => [4, 2]
	# The symmetric couple is reversed : [2, 4]
	#
	# In fine, the example yields the array : [[6,6], [4,2], [2,4], [6,6]]
	#
	# In the end, our string is read using the generated array
	#
	# SEE: `Text::unrail` for how the array is used
	private fun unrail_paces: Array[Couple[Int, Int]] do
		var ret = new Array[Couple[Int,Int]].with_capacity(self)
		var extremes = new Couple[Int, Int]((self - 1) * 2, (self - 1) * 2)
		for i in [0..self[ do
			ret.add extremes
		end
		var mid = ((self.to_f)/2.0).floor.to_i
		for i in [1 .. mid[ do
			var rd = i + 1
			var lodepth = self - rd
			var hidepth = (rd - self).abs
			var dd: Int
			if hidepth > lodepth then
				dd = hidepth * 2
			else
				dd = lodepth * 2
			end
			var cp = new Couple[Int, Int](dd, extremes.first-dd)
			var ccp = new Couple[Int, Int](extremes.first - dd, dd)

			ret[i] = cp
			ret[self - rd] = ccp
		end
		if not self.is_even then
			ret[mid] = new Couple[Int, Int](extremes.first/2, extremes.first/2)
		end
		return ret
	end
end
lib/crypto/basic_ciphers.nit:228,1--289,3

sdl2 :: sdl2_base $ Int
redef universal Int
	# Suspend execution for `self` milliseconds
	fun delay `{ SDL_Delay(self); `}
end
lib/sdl2/sdl2_base.nit:227,1--230,3

rubix :: rubix $ Int
redef class Int

	# Returns a coloured square for a defined colour id
	#
	# Assume colours are:
	#
	# * Green -> 0
	# * White (replaced with light gray) -> 1
	# * Red -> 2
	# * Yellow -> 3
	# * Orange (replaced with purple) -> 4
	# * Blue -> 5
	#
	private fun rubix_colour: String do
		if self == 0 then return square.green
		if self == 1 then return square.light_gray
		if self == 2 then return square.red
		if self == 3 then return square.yellow
		if self == 4 then return square.purple
		if self == 5 then return square.blue
		abort
	end
end
lib/rubix/rubix.nit:53,1--75,3

markdown2 :: markdown_block_parsing $ Int
redef class Int

	# Tab stop is 4
	private fun columns_to_next_tab_stop: Int do return 4 - (self % 4)
end
lib/markdown2/markdown_block_parsing.nit:1472,1--1476,3

jvm :: jvm $ Int
redef class Int
	redef fun to_jvalue(env): JValue `{
		jvalue value;
		value.i = self;
		return value;
	`}
end
lib/jvm/jvm.nit:509,1--515,3

gmp :: gmp $ Int
redef class Int
    redef fun to_bi do
        var tmp = new NativeMPZ
        tmp.set_si self
        return new BigInt(tmp)
    end

    redef fun to_r do
        var tmp = new NativeMPQ
        tmp.set_si(self, 1)
        return new Ratio(tmp)
    end
end
lib/gmp/gmp.nit:106,1--118,3

sqlite3 :: sqlite3 $ Int
redef universal Int super Sqlite3Data end
lib/sqlite3/sqlite3.nit:317,1--41

android :: load_image $ Int
redef universal Int
	# The first power of `exp` greater or equal to `self`
	private fun next_pow(exp: Int): Int
	do
		var p = 1
		while p < self do p = p*exp
		return p
	end
end
lib/android/load_image.nit:76,1--84,3

serialization :: serialization_core $ Int
redef class Int super DirectSerializable end
lib/serialization/serialization_core.nit:261,1--44

json :: serialization_write $ Int
redef class Int
	redef fun accept_json_serializer(v) do v.stream.write to_s
end
lib/json/serialization_write.nit:264,1--266,3

serialization :: inspect $ Int
redef class Int
	redef fun accept_inspect_serializer(v) do v.stream.write to_s
end
lib/serialization/inspect.nit:191,1--193,3

noise :: noise $ Int
redef universal Int
	# The value of the least-significant 30 bits of `self`
	#
	# This mask is used as compatibility with 32 bits architecture.
	# The missing 2 bits are used to tag integers by the Nit system.
	private fun mask: Int
	do
		return self & 0x3FFF_FFFF
	end
end
lib/noise/noise.nit:352,1--361,3

msgpack :: serialization_write $ Int
redef class Int
	redef fun accept_msgpack_serializer(v) do v.stream.write_msgpack_int self
end
lib/msgpack/serialization_write.nit:248,1--250,3

mpi :: mpi $ Int
redef universal Int
	# `self`th MPI rank
	fun rank: Rank `{ return self; `}

	# Tag identified by `self`
	fun tag: Tag `{ return self; `}

	# Is this value undefined according to MPI? (may be returned by `Status::count`)
	fun is_undefined: Bool `{ return self == MPI_UNDEFINED; `}
end
lib/mpi/mpi.nit:378,1--387,3

android :: bundle $ Int
redef class Int
	redef fun add_to_bundle(bundle, key)
	do
		bundle.put_long(key, self)
	end
end
lib/android/bundle/bundle.nit:686,1--691,3