Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.spec.ise

Class KL_NUMERIC


Direct ancestors

NUMERIC

Known direct descendants

MA_DECIMAL

Features

Invariants

indexing

description

Properties of numeric types

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2004, Paul G. Crismer and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2004/05/31 13:43:04 $

deferred class

KL_NUMERIC

inherit

NUMERIC
DEBUG_OUTPUT

feature -- Access

one: like Current

-- Neutral element for "*" and "/"

-- (From NUMERIC)

ensure
result_exists: Result /= Void
zero: like Current

-- Neutral element for "+" and "-"

-- (From NUMERIC)

ensure
result_exists: Result /= Void

feature -- Status report

divisible (other: like Current): BOOLEAN

-- May current object be divided by other?

-- (From NUMERIC)

require
other_exists: other /= Void
exponentiable (other: NUMERIC): BOOLEAN

-- May current object be elevated to the power other?

-- (From NUMERIC)

require
other_exists: other /= Void

feature -- Basic operations

infix "*" (other: like Current): like Current

-- Product by other

-- (From NUMERIC)

require
other_exists: other /= Void
ensure
result_exists: Result /= Void
infix "+" (other: like Current): like Current

-- Sum with other (commutative).

-- (From NUMERIC)

require
other_exists: other /= Void
ensure
result_exists: Result /= Void
commutative: equal (Result, other + Current)
infix "-" (other: like Current): like Current

-- Result of subtracting other

-- (From NUMERIC)

require
other_exists: other /= Void
ensure
result_exists: Result /= Void
infix "/" (other: like Current): like Current

-- Division by other

-- (From NUMERIC)

require
other_exists: other /= Void
good_divisor: divisible (other)
ensure
result_exists: Result /= Void
prefix "+": like Current

-- Unary plus

-- (From NUMERIC)

ensure
result_exists: Result /= Void
prefix "-": like Current

-- Unary minus

-- (From NUMERIC)

ensure
result_exists: Result /= Void

invariant

-- From NUMERIC

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end