Next: , Previous: , Up: Duration   [Index]


1.69.3 Duration: arithmetics

* factor

Answer a Duration that is ‘factor’ times longer than the receiver

+ aDuration

Answer a Duration that is the sum of the receiver and aDuration’s lengths.

- aDuration

Answer a Duration that is the difference of the receiver and aDuration’s lengths.

/ factorOrDuration

If the parameter is a Duration, answer the ratio between the receiver and factorOrDuration. Else divide the receiver by factorOrDuration (a Number) and answer a new Duration that is correspondingly shorter.

abs

Answer a Duration that is as long as the receiver, but always in the future.

days

Answer the number of days in the receiver

isZero

Answer whether the receiver correspond to a duration of zero seconds.

negated

Answer a Duration that is as long as the receiver, but with past and future exchanged.

negative

Answer whether the receiver is in the past.

positive

Answer whether the receiver is a zero-second duration or is in the future.

printOn: aStream

Print a represention of the receiver on aStream.