MCPcopy
hub / github.com/google/mangle / NewInterval

Function NewInterval

ast/temporal.go:328–336  ·  view source on GitHub ↗

NewInterval creates an interval from two bounds. Silently changes Start to NegativeInfinity and End to PositiveInfinity in case invalid bounds are passed.

(start, end TemporalBound)

Source from the content-addressed store, hash-verified

326// Silently changes Start to NegativeInfinity
327// and End to PositiveInfinity in case invalid bounds are passed.
328func NewInterval(start, end TemporalBound) Interval {
329 if start.Type == PositiveInfinityBound {
330 start = NegativeInfinity()
331 }
332 if end.Type == NegativeInfinityBound {
333 end = PositiveInfinity()
334 }
335 return Interval{Start: start, End: end}
336}
337
338// NewPointInterval creates an interval representing a single point in time.
339func NewPointInterval(t time.Time) Interval {

Calls 2

NegativeInfinityFunction · 0.85
PositiveInfinityFunction · 0.85