note description: "Functions useful in time calculations" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date: 2009-01-01 12:38:30 +0000 (Thu, 01 Jan 2009) $" revision: "$Revision: 76534 $" class TIME_UTILITY create default_create feature -- Basic operations mod (i, j: INTEGER_32): INTEGER_32 -- (i \\ j) if i positive -- (i \\ j + j) if i negative do Result := i \\ j if Result < 0 then Result := Result + j end ensure positive_result: Result >= 0 result_definition: i = j * div (i, j) + Result end div (i, j: INTEGER_32): INTEGER_32 -- (i \\ j) if i positive -- (i \\ j + 1) if i negative do Result := i // j if Result.to_double > i / j then Result := Result - 1 end ensure result_definition: i = j * Result + mod (i, j) end feature -- Access Date_time_tools: DATE_TIME_TOOLS -- Tools for outputting dates and times in different formats once create Result end default_format_string: STRING_8 -- Default output format string do Result := Date_time_tools.Default_format_string end note copyright: "Copyright (c) 1984-2009, 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 TIME_UTILITY
Generated by ISE EiffelStudio