note
	description: "Simple implementation of coefficients using a native array of characters"
	library: "Gobo Eiffel Decimal Arithmetic Library"
	copyright: "Copyright (c) 2004-2012, Paul G. Crismer and others"
	license: "MIT License"
	date: "$Date: 2016-05-06 19:15:38 +0000 (Fri, 06 May 2016) $"
	revision: "$Revision: 98678 $"

class interface
	MA_DECIMAL_COEFFICIENT_IMP

create 
	make,
	make_copy

feature -- Access

	item (index: INTEGER_32): INTEGER_32
			-- Item at index

	msd_index: INTEGER_32
			-- Index of most significant (non-zero) digit

	subcoefficient (index_start, index_end: INTEGER_32): MA_DECIMAL_COEFFICIENT
			-- Subcoefficient made of digits in range [index_start..index_end]
	
feature -- Measurement

	count: INTEGER_32
			-- Number of decimal digits

	lower: INTEGER_32
			-- Lower index

	upper: INTEGER_32
			-- Upper index

	capacity: INTEGER_32
			-- Capacity
	
feature -- Element change

	set_from_substring (s: STRING_8; coefficient_begin, coefficient_end: INTEGER_32)
			-- Set from s, skip the decimal point if it is present.

	grow (a_capacity: INTEGER_32)
			-- Grow coefficient so that it can contain up to a_capacity digits.

	put (v, index: INTEGER_32)
			-- Put v at index-th item.
	
feature -- Comparison

	three_way_comparison (other: like Current): INTEGER_32
			-- Compare other; Result is [-1,0,+1] if [Current < other, Current = other, Current > other] respectively
	
feature -- Conversion

	out: STRING_8
			-- Terse printable representation
	
feature -- Duplication

	copy (other: like Current)
			-- copy other into Current without aliasing.

	to_twin: like Current
			-- Cloned version of Current
	
feature -- Basic operations

	keep_head (a_count: INTEGER_32)
			-- Keep head of 'a_count' digits.

	is_equal (other: like Current): BOOLEAN
			-- Are Current and other considered equal?

	shift_left (a_count: INTEGER_32)
			-- Shift items left.

	shift_right (a_count: INTEGER_32)
			-- Shift items right.

	integer_add (other: like Current)
			-- Integer add of other to Current.

	integer_multiply (a, b: like Current)
			-- Multiply a, b into Current.

	integer_quick_add_msd (other, digits_count: INTEGER_32)
			-- Integer add of other (between 0 and 9) to Current,
			-- restricted to digits_count most significant digits.

	integer_subtract (other: like Current)
			-- Integer subtract of other to Current,
			-- provided that result will not be negative.

	integer_quick_subtract_msd (other, digits_count: INTEGER_32)
			-- Integer subtract of other (between 0 and 9) to Current
			-- restricted to digits_count most significant digits.
	
invariant
	digits_not_void: digits /= Void

end -- class MA_DECIMAL_COEFFICIENT_IMP

Generated by ISE EiffelStudio