Skip to content

meos.js


meos.js / FloatSpan

Class: FloatSpan

Defined in: core/types/collections/number/FloatSpan.ts:32

A contiguous range of IEEE 754 double-precision floats.

Example

ts
const s = FloatSpan.fromBounds(1.5, 10.5); // [1.5, 10.5)
console.log(s.lower()); // 1.5
console.log(s.width()); // 9.0
s.free();

Extends

Constructors

Constructor

ts
new FloatSpan(inner): FloatSpan;

Defined in: core/types/collections/base/Span.ts:45

Parameters

inner

number

Returns

FloatSpan

Inherited from

Span.constructor

Accessors

inner

Get Signature

ts
get inner(): number;

Defined in: core/types/collections/base/Span.ts:57

Raw WASM heap pointer. Do not free this value directly; use free.

Returns

number

Inherited from

Span.inner

Methods

[dispose]()

ts
dispose: void;

Defined in: core/types/collections/base/Span.ts:67

Implements the using resource-management protocol — calls free automatically.

Returns

void

Inherited from

Span.[dispose]


asHexWKB()

ts
asHexWKB(variant?): string;

Defined in: core/types/collections/base/Span.ts:90

Serialises this span to a hex-encoded WKB string.

Parameters

variant?

number = 4

WKB encoding variant (default 4 = Extended WKB).

Returns

string

Inherited from

Span.asHexWKB


ceil()

ts
ceil(): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:148

Returns a new span with both bounds rounded up to the nearest integer.

Returns

FloatSpan


contains()

ts
contains(other): boolean;

Defined in: core/types/collections/base/Span.ts:149

true if this entirely contains other.

Parameters

other

this

Returns

boolean

Inherited from

Span.contains


copy()

ts
copy(): this;

Defined in: core/types/collections/base/Span.ts:75

Returns a deep copy of this span. The caller is responsible for calling free on the returned copy.

Returns

this

Inherited from

Span.copy


degrees()

ts
degrees(normalize?): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:169

Converts bounds from radians to degrees.

Parameters

normalize?

boolean = false

If true, normalises the result to [0, 360) (default false).

Returns

FloatSpan


distance()

ts
distance(other): number;

Defined in: core/types/collections/number/FloatSpan.ts:123

Returns the distance (gap) between this and other. Returns 0 if they overlap or are adjacent.

Parameters

other

this

Returns

number

Overrides

Span.distance


eq()

ts
eq(other): boolean;

Defined in: core/types/collections/base/Span.ts:233

true if this and other have identical bounds and inclusivity.

Parameters

other

this

Returns

boolean

Inherited from

Span.eq


expand()

ts
expand(value): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:143

Returns a new span expanded by value on each side.

Parameters

value

number

Amount to add to each end.

Returns

FloatSpan


floor()

ts
floor(): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:153

Returns a new span with both bounds rounded down to the nearest integer.

Returns

FloatSpan


free()

ts
free(): void;

Defined in: core/types/collections/base/Span.ts:62

Releases the WASM-allocated memory. Must be called when the object is no longer needed.

Returns

void

Inherited from

Span.free


ge()

ts
ge(other): boolean;

Defined in: core/types/collections/base/Span.ts:258

true if this is greater than or equal to other in MEOS total ordering.

Parameters

other

this

Returns

boolean

Inherited from

Span.ge


gt()

ts
gt(other): boolean;

Defined in: core/types/collections/base/Span.ts:253

true if this is strictly greater than other in MEOS total ordering.

Parameters

other

this

Returns

boolean

Inherited from

Span.gt


hash()

ts
hash(): number;

Defined in: core/types/collections/base/Span.ts:121

32-bit integer hash of this span.

Returns

number

Inherited from

Span.hash


intersection()

ts
intersection(other): FloatSpan | null;

Defined in: core/types/collections/base/Span.ts:207

Returns the intersection of this and other, or null if they are disjoint. The caller is responsible for calling free on the result.

Parameters

other

this

Returns

FloatSpan | null

Inherited from

Span.intersection


isAdjacent()

ts
isAdjacent(other): boolean;

Defined in: core/types/collections/number/FloatSpan.ts:108

true if this and other touch at exactly one boundary point without overlapping. For example, [1.0, 5.0) is adjacent to [5.0, 10.0].

Parameters

other

this

Returns

boolean

Overrides

Span.isAdjacent


isAfter()

ts
isAfter(other): boolean;

Defined in: core/types/collections/base/Span.ts:176

true if every point in this is strictly greater than every point in other (no overlap).

Parameters

other

this

Returns

boolean

Inherited from

Span.isAfter


isBefore()

ts
isBefore(other): boolean;

Defined in: core/types/collections/base/Span.ts:163

true if every point in this is strictly less than every point in other (no overlap).

Parameters

other

this

Returns

boolean

Inherited from

Span.isBefore


isContainedIn()

ts
isContainedIn(other): boolean;

Defined in: core/types/collections/base/Span.ts:144

true if this is entirely contained within other.

Parameters

other

this

Returns

boolean

Inherited from

Span.isContainedIn


isOverOrAfter()

ts
isOverOrAfter(other): boolean;

Defined in: core/types/collections/base/Span.ts:184

true if this does not extend to the left of other (i.e. min(this) ≥ min(other)).

Parameters

other

this

Returns

boolean

Inherited from

Span.isOverOrAfter


isOverOrBefore()

ts
isOverOrBefore(other): boolean;

Defined in: core/types/collections/base/Span.ts:171

true if this does not extend to the right of other (i.e. max(this) ≤ max(other)).

Parameters

other

this

Returns

boolean

Inherited from

Span.isOverOrBefore


le()

ts
le(other): boolean;

Defined in: core/types/collections/base/Span.ts:248

true if this is less than or equal to other in MEOS total ordering.

Parameters

other

this

Returns

boolean

Inherited from

Span.le


lower()

ts
lower(): number;

Defined in: core/types/collections/number/FloatSpan.ts:86

Returns the lower bound as a float.

Returns

number

Overrides

Span.lower


lowerInc()

ts
lowerInc(): boolean;

Defined in: core/types/collections/base/Span.ts:111

true if the lower bound is inclusive ([).

Returns

boolean

Inherited from

Span.lowerInc


lt()

ts
lt(other): boolean;

Defined in: core/types/collections/base/Span.ts:243

true if this is strictly less than other in MEOS total ordering.

Parameters

other

this

Returns

boolean

Inherited from

Span.lt


minus()

ts
minus(other): number;

Defined in: core/types/collections/base/Span.ts:216

Returns the part of this that is not in other as a raw WASM pointer. The result may represent a SpanSet when the subtraction splits this span into two parts.

Parameters

other

this

Returns

number

Inherited from

Span.minus


ne()

ts
ne(other): boolean;

Defined in: core/types/collections/base/Span.ts:238

true if this and other differ in at least one bound or inclusivity.

Parameters

other

this

Returns

boolean

Inherited from

Span.ne


overlaps()

ts
overlaps(other): boolean;

Defined in: core/types/collections/base/Span.ts:154

true if this and other share at least one point.

Parameters

other

this

Returns

boolean

Inherited from

Span.overlaps


radians()

ts
radians(): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:174

Converts bounds from degrees to radians.

Returns

FloatSpan


round()

ts
round(maxdd): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:161

Returns a new span with bounds rounded to maxdd decimal places.

Parameters

maxdd

number

Number of decimal digits to keep.

Returns

FloatSpan


toIntSpan()

ts
toIntSpan(): number;

Defined in: core/types/collections/number/FloatSpan.ts:135

Converts this span to an IntSpan by truncating bounds and returns the raw WASM pointer. Use new IntSpan(ptr) to obtain a typed object.

Returns

number


toSpanSet()

ts
toSpanSet(): number;

Defined in: core/types/collections/base/Span.ts:129

Wraps this span in a one-element SpanSet and returns the raw WASM pointer. Use the appropriate SpanSet constructor (e.g. new IntSpanSet(ptr)) to obtain a typed object.

Returns

number

Inherited from

Span.toSpanSet


toString()

ts
toString(maxdd?): string;

Defined in: core/types/collections/number/FloatSpan.ts:81

Returns the WKT string representation.

Parameters

maxdd?

number = 15

Maximum decimal digits of precision (default 15).

Returns

string

Overrides

Span.toString


union()

ts
union(other): number;

Defined in: core/types/collections/base/Span.ts:224

Returns the union of this and other as a raw WASM pointer. The spans do not need to be adjacent or overlapping.

Parameters

other

this

Returns

number

Inherited from

Span.union


upper()

ts
upper(): number;

Defined in: core/types/collections/number/FloatSpan.ts:91

Returns the upper bound as a float.

Returns

number

Overrides

Span.upper


upperInc()

ts
upperInc(): boolean;

Defined in: core/types/collections/base/Span.ts:116

true if the upper bound is inclusive (]).

Returns

boolean

Inherited from

Span.upperInc


width()

ts
width(): number;

Defined in: core/types/collections/number/FloatSpan.ts:96

Returns the length of this span (upper - lower).

Returns

number


fromBounds()

ts
static fromBounds(
   lower, 
   upper, 
   lowerInc?, 
   upperInc?): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:56

Creates a FloatSpan from explicit float bounds.

Parameters

lower

number

Lower bound value.

upper

number

Upper bound value.

lowerInc?

boolean = true

true for inclusive lower bound [ (default).

upperInc?

boolean = false

true for inclusive upper bound ] (default false).

Returns

FloatSpan


fromHexWKB()

ts
static fromHexWKB(hexwkb): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:69

Deserialises a FloatSpan from a hex-encoded WKB string produced by asHexWKB.

Parameters

hexwkb

string

Hex-encoded WKB string.

Returns

FloatSpan


fromString()

ts
static fromString(str): FloatSpan;

Defined in: core/types/collections/number/FloatSpan.ts:45

Parses a FloatSpan from its WKT string representation.

Parameters

str

string

WKT string, e.g. "[1.5, 10.5)".

Returns

FloatSpan