INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Some useful facilities on objects of basic types "
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997-1998 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
cluster: eiffelbase
class BASIC_ROUTINES
inherit

ISE_GENERAL
end
feature -- Conversion

charconv (i: INTEGER): CHARACTER
-- Character corresponding to ascii code `i'

charcode (c: CHARACTER): INTEGER
obsolete "Instead of charcode (c) use c.code"
-- Integer ascii code corresponding to `c'

integer_to_real (n: INTEGER): REAL
obsolete "Use target := `n'"
-- Real conversion of `n'

real_to_integer (r: REAL): INTEGER
obsolete "Instead of real_to_integer (r) use r.truncated_to_integer"
-- Integer conversion (truncation) of `r'

double_to_real (d: DOUBLE): REAL
obsolete "Instead of double_to_real (d) use d.truncated_to_real"
-- Real conversion (truncation) of `d'

real_to_double (r: REAL): DOUBLE
obsolete "Use target := `r' instead."
-- Double conversion of `r'

double_to_integer (d: DOUBLE): INTEGER
obsolete "Instead of double_to_integer (d) use d.truncated_to_integer"
-- Integer conversion (truncation) of `d'
feature -- Basic operations

abs (n: INTEGER): INTEGER
obsolete "Use n.abs instead"
-- Absolute value of `n'
ensure
non_negative_result: Result >= 0

sign (n: INTEGER): INTEGER
obsolete "Use n.sign instead"
-- Sign of `n':
-- -1 if `n' < 0
-- 0 if `n' = 0
-- +1 if `n' > 0
ensure
correct_negative: (n < 0) = (Result = -1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = 1)

max (n1, n2: INTEGER): INTEGER
obsolete "Replace max (a, b) with a.max (b)"
-- Maximum of `n1' and `n2'
ensure
is_maximum: (n2 >= n1) = (Result = n2) or else (n1 > n2) = (Result = n1)

min (n1, n2: INTEGER): INTEGER
obsolete "Replace min (a, b) with a.min (b)"
-- Minimum of `n1' and `n2'
ensure
is_minimum: (n2 <= n1) = (Result = n2) or else (n1 < n2) = (Result = n1)

rsign (r: REAL): INTEGER
obsolete "Use r.sign instead"
-- Sign of `r':
-- -1 if `r' < 0
-- 0 if `r' = 0
-- +1 if `r' > 0
ensure
correct_negative: (r < 0) = (Result = -1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = 1)

rmax (r1, r2: REAL): REAL
obsolete "Replace rmax (a, b) with a.max (b)"
-- Maximum of `r1' and `r2'
ensure
is_maximum: (r2 >= r1) = (Result = r2) or else (r1 > r2) = (Result = r1)

rmin (r1, r2: REAL): REAL
obsolete "Replace rmin (a, b) with a.min (b)"
-- Minimum of `r1' and `r2'
ensure
is_minimum: (r2 <= r1) = (Result = r2) or else (r1 < r2) = (Result = r1)

bottom_int_div (n1, n2: INTEGER): INTEGER
-- Greatest lower bound of the integer division of `n1' by `n2'

up_int_div (n1, n2: INTEGER): INTEGER
-- Least upper bound of the integer division
-- of `n1' by `n2'
end -- class BASIC_ROUTINES

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES