[[Property:title|More precision]] [[Property:weight|4]] [[Property:uuid|fadf5bc2-bb72-f681-b9c4-bab7f0633209]] The classes <eiffel>TIME</eiffel> and <eiffel>TIME_DURATION</eiffel> are designed to deal with time in high precision, limited only by platform numerical representation. The classes <eiffel>TIME</eiffel> and <eiffel>TIME_DURATION</eiffel> have an attribute <eiffel>fine_second</eiffel> of type <eiffel>DOUBLE</eiffel> which allows high precision. This attribute represents the number of seconds with fractions. From <eiffel>fine_second</eiffel> are calculated the values for <eiffel>second</eiffel> and <eiffel>fractional_second</eiffel>. <eiffel>second</eiffel> is the truncated-to-integer part of <eiffel>fine_second</eiffel> and <eiffel>fractional_second</eiffel> is the fractional part of <eiffel>fine_second</eiffel>. When <eiffel>fine_second</eiffel> is positive, 3.55 for example, <eiffel>second</eiffel> and <eiffel>fractional_second</eiffel> are both positive (3 and 0.55, respectively). When <eiffel>fine_second</eiffel> is negative (- 3.55 for example), then <eiffel>second</eiffel> and <eiffel>fractional_second</eiffel> are both negative (- 3 and - 0.55). Manipulation on second and fractional_second are in fact always made through fine_second. Users who do not want to deal with precision do not need to care about this. Features dealing with <eiffel>fine_second</eiffel> and <eiffel>fractional_second</eiffel> are described here. ====Creation (common to <eiffel>TIME, </eiffel> <eiffel>TIME_DURATION</eiffel>)==== * <eiffel>make_fine</eiffel> is similar to <eiffel>make</eiffel> except that it takes a <eiffel>DOUBLE</eiffel> for its third argument (instead of an <eiffel>INTEGER</eiffel>, as is the case with <eiffel>make</eiffel>). <eiffel>fine_second</eiffel> is then set to this value. * <eiffel>make_by_fine_seconds</eiffel> is similar to <eiffel>make_by_seconds</eiffel> except that it takes a <eiffel>DOUBLE</eiffel> for an argument (instead of an <eiffel>INTEGER</eiffel>, as is the case with<eiffel>make_by_seconds</eiffel>). ====Measurement and access==== In <eiffel>TIME</eiffel>: * <eiffel>fine_seconds</eiffel> looks like seconds but it contains fractions. In <eiffel>TIME_DURATION</eiffel>: * <eiffel>fine_seconds_count</eiffel> looks like <eiffel>seconds_count</eiffel> but it contains fractions. ====Element change==== * Set <eiffel>fine_second</eiffel> directly with <eiffel>set_fine_second</eiffel>. * Set <eiffel>fractional_second</eiffel> directly with <eiffel>set_fractionals</eiffel>. {{note|Use of the feature <eiffel>set_second</eiffel> (in either <eiffel>TIME</eiffel> and <eiffel>TIME_DURATION</eiffel>) will result in <eiffel>fractional_second</eiffel> having a value of zero. }} ====Operations==== * <eiffel>fine_second_add</eiffel> looks like <eiffel>second_add</eiffel> except that it takes a <eiffel>DOUBLE</eiffel> as an argument.