Fixing some issues with infinity in domains.

This commit is contained in:
Adsooi 2023-10-08 16:24:16 +02:00
parent d6a83b0f4b
commit 3039aade29
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
3 changed files with 6 additions and 5 deletions

View file

@ -26,7 +26,8 @@ var ADDITIONAL_VARCHARS = [
"ₕ","ₖ","ₗ","ₘ","ₙ","ₚ","ₛ", "ₕ","ₖ","ₗ","ₘ","ₙ","ₚ","ₛ",
"ₜ","¹","²","³","⁴","⁵","⁶", "ₜ","¹","²","³","⁴","⁵","⁶",
"⁷","⁸","⁹","⁰","₁","₂","₃", "⁷","⁸","⁹","⁰","₁","₂","₃",
"₄","₅","₆","₇","₈","₉","₀" "₄","₅","₆","₇","₈","₉","₀",
"∞"
] ]
function Instruction(type, value) { function Instruction(type, value) {

View file

@ -437,8 +437,8 @@ class UnionDomain extends Domain {
static import(frm) { static import(frm) {
var domains = frm.trim().split("") var domains = frm.trim().split("")
if(domains.length == 1) domains = frm.trim().split("U") // Fallback if(domains.length == 1) domains = frm.trim().split("U") // Fallback
var dom1 = parseDomain(domains.pop()) var dom2 = parseDomain(domains.pop())
var dom2 = parseDomain(domains.join('')) var dom1 = parseDomain(domains.join(''))
return dom1.union(dom2) return dom1.union(dom2)
} }
} }

View file

@ -114,7 +114,7 @@ function variable(vari, wrapIn$ = false) {
"ₜ","¹","²","³","⁴","⁵","⁶", "ₜ","¹","²","³","⁴","⁵","⁶",
"⁷","⁸","⁹","⁰","₁","₂","₃", "⁷","⁸","⁹","⁰","₁","₂","₃",
"₄","₅","₆","₇","₈","₉","₀", "₄","₅","₆","₇","₈","₉","₀",
"pi"] "pi", "∞"]
let equivalchars = ["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\zeta","\\eta", let equivalchars = ["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\zeta","\\eta",
"\\pi","\\theta","\\kappa","\\lambda","\\mu","\\xi","\\rho", "\\pi","\\theta","\\kappa","\\lambda","\\mu","\\xi","\\rho",
"\\sigma","\\sigma","\\tau","\\phi","\\chi","\\psi","\\omega", "\\sigma","\\sigma","\\tau","\\phi","\\chi","\\psi","\\omega",
@ -124,7 +124,7 @@ function variable(vari, wrapIn$ = false) {
"{}_{t}","{}^{1}","{}^{2}","{}^{3}","{}^{4}","{}^{5}","{}^{6}", "{}_{t}","{}^{1}","{}^{2}","{}^{3}","{}^{4}","{}^{5}","{}^{6}",
"{}^{7}","{}^{8}","{}^{9}","{}^{0}","{}_{1}","{}_{2}","{}_{3}", "{}^{7}","{}^{8}","{}^{9}","{}^{0}","{}_{1}","{}_{2}","{}_{3}",
"{}_{4}","{}_{5}","{}_{6}","{}_{7}","{}_{8}","{}_{9}","{}_{0}", "{}_{4}","{}_{5}","{}_{6}","{}_{7}","{}_{8}","{}_{9}","{}_{0}",
"\\pi"] "\\pi", "\\infty"]
if(wrapIn$) if(wrapIn$)
for(let i = 0; i < unicodechars.length; i++) { for(let i = 0; i < unicodechars.length; i++) {
if(vari.includes(unicodechars[i])) if(vari.includes(unicodechars[i]))