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

Function optionsToInternal

src/compute-engine/boxed-expression/box.ts:135–146  ·  view source on GitHub ↗
(options?: {
  form?: FormOption;
  canonical?: CanonicalOptions;
  structural?: boolean;
})

Source from the content-addressed store, hash-verified

133 * otherwise, they should all be done in machine numbers.
134 * - if a rational is encountered, preserve it
135 * - if a `Sqrt` of a rational is encountered, preserve it
136 * - if a `hold` constant is encountered, preserve it
137 * - if `numericApproximation` is false and one of the arguments is not exact,
138 * return an approximation
139 * - if `numericApproximation` is true, always return an approximation
140 *
141 * NUMERIC APPROXIMATION = FALSE
142 * - 2 + 5 -> 7
143 * - 2 + 5/7 -> 19/7
144 * - 2 + √2 -> 2 + √2
145 * - 2 + √(5/7) -> 2 + √(5/7)
146 * - 5/7 + 9/11 -> 118/77
147 * - 5/7 + √2 -> 5/7 + √2
148 * - 10/14 + √(18/9) -> 5/7 + √2
149 * - √2 + √5 -> √2 + √5

Callers 3

exprMethod · 0.90
parseMethod · 0.90
functionMethod · 0.90

Calls 1

formToInternalFunction · 0.85

Tested by

no test coverage detected