abs2

num.abs2 â real Instance Public methods Returns square of self.

angle

num.angle â 0 or float Instance Public methods Returns 0 if the value is positive, pi otherwise.

arg

num.arg â 0 or float Instance Public methods Returns 0 if the value is positive, pi otherwise.

ceil

num.ceil â integer Instance Public methods Returns the smallest Integer greater than or equal to num. Class Numeric achieves this by converting itself to a Float then invoking Float#ceil. 1.ceil #=> 1 1.2.ceil #=> 2 (-1.2).ceil #=> -1 (-1.0).ceil #=> -1

coerce

num.coerce(numeric) â array Instance Public methods If aNumeric is the same type as num, returns an array containing aNumeric and num. Otherwise, returns an array with both aNumeric and num represented as Float objects. This coercion mechanism is used by Ruby to handle mixed-type numeric operations: it is intended to find a compatible common type between the two operands of the operator. 1.coerce(2.5) #=> [2.5, 1.0] 1.2.coerce(3) #=> [3.0, 1.2] 1.coerce(2) #=> [

conj

num.conj â selfnum.conjugate â self Instance Public methods Returns self.

conjugate

num.conjugate â self Instance Public methods Returns self.

denominator

num.denominator â integer Instance Public methods Returns the denominator (always positive).

div

num.div(numeric) â integer Instance Public methods Uses / to perform division, then converts the result to an integer. numeric does not define the / operator; this is left to subclasses. Equivalent to num.divmod(aNumeric). See Numeric#divmod.

divmod

num.divmod(numeric) â array Instance Public methods Returns an array containing the quotient and modulus obtained by dividing num by numeric. If q, r = x.divmod(y), then q = floor(x/y) x = q*y+r The quotient is rounded toward -infinity, as shown in the following table: a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b) ------+-----+---------------+---------+-------------+--------------- 13 | 4 | 3, 1 | 3 | 1 | 1 ------+-----+-