MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / signedMembership

Function signedMembership

src/compute-engine/library/sets.ts:76–86  ·  view source on GitHub ↗

* Three-valued membership for a set defined by a base type together with a * sign predicate (e.g. the negative reals). `sign` is the relevant three-valued * sign property of `x` (e.g. `x.isNegative`).

(
  x: Expression,
  baseType: Type,
  sign: boolean | undefined
)

Source from the content-addressed store, hash-verified

74// compactification, so the unsigned `~oo` of the Riemann sphere is not a
75// member of any of these three. The extended COMPLEX plane is the one that
76// takes it, and it takes every infinite magnitude with it.
77//
78// The infinities are spelled as the two value types `+oo | -oo` — the
79// signed pair {+∞, −∞}, which is also what the retired one-word name
80// `non_finite_number` normalizes to on input. An operand typed with the
81// pair (`Ln(0)`, a symbol declared with the retired spelling) IS a subtype
82// of `real | +oo | -oo`, so its membership decides. The pair excludes both
83// `~oo` and NaN, so the two-point claim above is unaffected.
84const EXTENDED_RATIONAL_TYPE = parseType('rational | +oo | -oo');
85const EXTENDED_INTEGER_TYPE = parseType('integer | +oo | -oo');
86const EXTENDED_COMPLEX_TYPE = parseType('complex | infinity');
87
88/**
89 * Build the `subsetOf` handler of a number set that contains EVERY value of

Callers 1

sets.tsFile · 0.85

Calls 1

typeMembershipFunction · 0.85

Tested by

no test coverage detected