note
	description: "Information about integer, natural and real type in Eiffel"
	library: "Free implementation of ELKS library"
	status: "See notice at end of class."
	legal: "See notice at end of class."
	date: "$Date: 2018-04-28 20:47:11 +0000 (Sat, 28 Apr 2018) $"
	revision: "$Revision: 101695 $"

class 
	NUMERIC_INFORMATION

create 
	default_create

feature -- Types

	max_integer_type: INTEGER_64
			-- INTEGER type of max word length
		do
		ensure
			instance_free: class
		end

	max_natural_type: NATURAL_64
			-- NATURAL type of max word length
		do
		ensure
			instance_free: class
		end

	Type_count: INTEGER_32 = 4
			-- Number of types of integer/natural in Eiffel

	Type_no_limitation: INTEGER_32 = 0
			-- Type representing a number sequence (no length limitation)

	Type_integer_natural_separator: INTEGER_32 = 10

	Type_integer_8: INTEGER_32 = 1

	Type_integer_16: INTEGER_32 = 2

	Type_integer: INTEGER_32 = 3
			-- Was declared in NUMERIC_INFORMATION as synonym of Type_integer_32.

	Type_integer_32: INTEGER_32 = 3
			-- Was declared in NUMERIC_INFORMATION as synonym of Type_integer.

	Type_integer_64: INTEGER_32 = 4

	Type_natural_8: INTEGER_32 = 11

	Type_natural_16: INTEGER_32 = 12

	Type_natural: INTEGER_32 = 13
			-- Was declared in NUMERIC_INFORMATION as synonym of Type_natural_32.

	Type_natural_32: INTEGER_32 = 13
			-- Was declared in NUMERIC_INFORMATION as synonym of Type_natural.

	Type_natural_64: INTEGER_32 = 14
			-- Integer/natural type indicators

	Type_real: INTEGER_32 = 100

	Type_double: INTEGER_32 = 101
			-- Real/Double type indicators
	
feature -- Type checking

	integer_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid integer type?
		do
			Result := (type = Type_integer_8) or (type = Type_integer_16) or (type = Type_integer_32) or (type = Type_integer_64)
		ensure
			instance_free: class
		end

	natural_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid natural type?
		do
			Result := (type = Type_natural_8) or (type = Type_natural_16) or (type = Type_natural_32) or (type = Type_natural_64)
		ensure
			instance_free: class
		end

	integer_natural_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid integer/natural type?
		do
			Result := (type = Type_no_limitation) or (type = Type_integer_8) or (type = Type_integer_16) or (type = Type_integer_32) or (type = Type_integer_64) or (type = Type_natural_8) or (type = Type_natural_16) or (type = Type_natural_32) or (type = Type_natural_64)
		ensure
			instance_free: class
		end

	real_double_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid real/double type?
		do
			Result := type = Type_no_limitation or type = Type_real or type = Type_double
		ensure
			instance_free: class
		end

	real_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid real type?
		do
			Result := type = Type_real
		ensure
			instance_free: class
		end

	double_type_valid (type: INTEGER_32): BOOLEAN
			-- Is type a valid double type?
		do
			Result := type = Type_double
		ensure
			instance_free: class
		end
	
note
	copyright: "Copyright (c) 1984-2018, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class NUMERIC_INFORMATION

Generated by ISE EiffelStudio