C++ Boost

Date-Time Concepts - Calculation


Overall Index -- Gregorian Index -- Posix Time Index

Timepoints -- Durations -- Interval -- Special Cases

Timepoints

This section describes some of basic arithmetic rules that can be performed with GDTL timepoints.
このセクションでは,GDTL timepoints で行える基本的な算術規則をいくつか示す。

 Timepoint + Duration --> Timepoint
 Timepoint - Duration --> Timepoint
 
 Duration + Timepoint --> Undefined 
 Duration - Timepoint --> Undefined
 
 Timepoint + Timepoint --> Undefined
 Timepoint - Timepoint --> Duration

Durations

This section describes standard operations for a time duration.
このセクションでは時間長(time duration)に関する標準的な演算を示す。

 Duration + Duration  --> Duration
 Duration - Duration  --> Duration

 Duration * Integer   --> Duration  
 Integer  * Duration  --> Duration  

 Duration(∞) * Integer --> Duration(∞) 
 Duration(∞)/Integer   --> Duration(∞) 

Intervals

Here are the "operations" supported by intervals. They are based on half-open range.
ここに時間間隔(intervals)によって支援された"演算"がある。 それらは半開区間に基づいている。

 //These can be defined by either of 2 Timepoints or a Timepoint and Duration
 Timeinterval intersects Timeinterval --> bool
 Timeinterval intersection Timeinterval --> Timeperiod //results undefined if no intersection 
 Timeinterval contains  Timepoint    --> bool
 Timeinterval contains  Timeinterval --> bool  
 Timeinterval shift Duration         --> shift start and end by duration amount

Special Cases

In general special values such as Not A Date Time (NADT) and infinity should follow rules like floating point values. Note that it should be possible to configure NADT based systems to throw an exception instead of result in NADT.
一般に,非日時値(NADT;Not A Date Time)や無限大といった特別な値は,浮動小数点値のような規則に従うべきである。 戻り値として NADT を返す代わりに,例外を投げるNADTに基づいたシステムを形成することが可能であるべきであることに注意する必要がある。

 Timepoint(NADT) + Duration --> Timepoint(NADT)
 Timepoint(∞) + Duration --> Timepoint(∞)
 Timepoint + Duration(∞) --> Timepoint(∞)
 Timepoint - Duration(∞) --> Timepoint(-∞)
∞ は ∞ にすべきか ∞ にすべきか…

Last modified: Fri Aug 30 11:11:40 MST 2002 by Jeff Garland © 2000-2002
Japanese Translation Copyright (C) 2003 Shoji Shinohara.