deferred class NUMERIC

Features exported to INTERNALS_HANDLER

This class describes a ring.

Direct parents

conformant parents

HASHABLE

Known children

conformant children

INTEGER_GENERAL, REAL_GENERAL

Summary

exported features

Details

deferred + (other: NUMERIC): NUMERIC

Sum with other (commutative).

deferred - (other: NUMERIC): NUMERIC

Result of substracting other.

deferred * (other: NUMERIC): NUMERIC

Product by other.

deferred / (other: NUMERIC): NUMERIC

Division by other.

require

  • other /= Void
  • divisible(other)

deferred +: NUMERIC

Unary plus of Current.

deferred -: NUMERIC

Unary minus of Current.

deferred divisible (other: NUMERIC): BOOLEAN

May Current be divided by other ?

require

  • other /= Void

deferred one: NUMERIC

Neutral element for "*" and "/".

deferred zero: NUMERIC

Neutral element for "+" and "-".

deferred sign: INTEGER_8

Sign of Current (0 -1 or 1).

ensure

  • -1 <= Result
  • Result <= 1

deferred hash_code: INTEGER

The hash-code value of Current.

ensure

  • good_hash_value: Result >= 0

deferred is_equal (other: NUMERIC): BOOLEAN

Is other attached to an object considered equal to current object ?

require

  • other /= Void

ensure

  • Result implies hash_code = other.hash_code
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)