Skip to content

Switch with Infinity #956

@b1f6c1c4

Description

@b1f6c1c4

Description

How to Reproduce

{MatchQ[Infinity,Infinity],Switch[Infinity,Infinity,True,_,False]}

Output Given

{True,False}

Expected behavior

{True,True}

I don't see any reason this shouldn't evaluate to two Trues. FYI, Wolfram Mathematica gives this result.

Your Environment

docker run --rm -it -p 8000:8000 mathicsorg/mathics -m gui
Software Information
Python
Python: 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
Implementation: CPython 3.10.6.final.0
Mathics3 Software
Mathics3 Django: 7.0.0dev0
Mathics3: 7.0.0dev0
Web Software
Django: 4.2.3
mathics-threejs-backend: 1.3.1
three.js: 146
MathJax: 2.7.9
Numeric Software
mpmath: 1.3.0
Numpy: 1.25.0
Sympy: 1.12
Optional Software
cython: 3.0.0
lxml: 4.9.3
networkx: 3.1
nltk: 3.8.1
psutil: 5.9.5
skimage: 0.21.0
scipy: 1.10.1
wordcloud: 1.9.2
Settings
Django
ALLOWED_HOSTS: []
DEBUG: True
DISPLAY_EXCEPTIONS: False
Mathics3 Django
Settings`$PreferredBackendMethod: "sympy"
This sets whether to use mpmath, numpy or Sympy for numeric and symbolic constants and methods, when there is a choice.
Settings`$QuotedStrings: 
If this Boolean variable is set False, hide the quotes when the top-level value is a string.
Settings`$TraceGet: 
If this Boolean variable is set True, 'Get' traces the lines it reads that start a new expression.
Settings`$UseSansSerif: 
If this Boolean variable is set True, MathMLForm uses a Sans-Serif font.
System information
User Name: mathics
Process ID: 1
System Time Zone: -6.0 hours from UTC
File Paths
Base Directory: /usr/src/app/mathics-core/mathics
Home Directory: /usr/src/app
Installation Directory: /usr/src/app/mathics-core/mathics
Root Directory: /
Temporary Directory: /tmp
Workspace Database File: /usr/src/app/.local/var/mathics/mathics.sqlite
Doctest Data: /usr/src/app/mathics-core/mathics/doc/doc_html_data.pcl
Machine information
Machine Name: 3021451861bc
Machine: linux
Processor Type: x86_64
Memory Available: 24231600128
System Memory: 33357537280
Machine Precision: 15.954589770191003
Mathics3 Setttings
Maximum Digits allowed in a String: unlimited
System Charecter Encoding: UTF-8
Time format is 12 Hour?: False
Connection Information
HTTP User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Remote User:
Remote Address: 172.17.0.1
Remote Host:

Workarounds

Use If[MatchQ[]] instead of Switch

Priority

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions