Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issues about numerical constants #23

Open
shigma opened this issue Nov 4, 2018 · 6 comments
Open

Some issues about numerical constants #23

shigma opened this issue Nov 4, 2018 · 6 comments

Comments

@shigma
Copy link
Collaborator

shigma commented Nov 4, 2018

built_in_numeric_constants defines some numerical constants for wolfram language, but here are some minor issues:

  1. Infinity and Indeterminate seems numerical constants to me, for they have mathematical meaning and we can just do any mathematical operations on them.
  2. MachinePrecision seems a little bit strange compared with other constants. It may be just have a numerical value. If accepted, should some other built-in symbols with numerical values (including but not limited to numbers defined here) be accepted too?
@batracos
Copy link
Collaborator

batracos commented Nov 4, 2018

  1. All the symbols now in built_in_numeric_constants are NumericQ. Neither Infinity nor Indeterminate satisfy that. I see your point though. What do the other people think?
  2. MachinePrecision is a numerical constant, $MachinePrecision and other symbols is that page are numbers.
In[21]:= Through[{NumberQ, NumericQ}[$MachinePrecision]]
Out[21]= {True, True}

In[22]:= Through[{NumberQ, NumericQ}[MachinePrecision]]
Out[22]= {False, True}

@shigma
Copy link
Collaborator Author

shigma commented Nov 5, 2018

You've got a point here.

@chere005 @ViktorQvarfordt any ideas?

@chere005
Copy link
Collaborator

chere005 commented Nov 8, 2018

I think Infinity and Indeterminate make sense in the same way as MachinePrecision. Perhaps calling these built_in_numeric_constants is the issue, and they should just be called built_in_math_constants or built_in_constants. I approach this more from the angle how do I want my code to look and I would like some visual identifier for these in the same way I would want an identifier for Pi

@shigma
Copy link
Collaborator Author

shigma commented Nov 10, 2018

  1. All the symbols now in built_in_numeric_constants are NumericQ. Neither Infinity nor Indeterminate satisfy that. I see your point though. What do the other people think?
  2. MachinePrecision is a numerical constant, $MachinePrecision and other symbols is that page are numbers.
In[21]:= Through[{NumberQ, NumericQ}[$MachinePrecision]]
Out[21]= {True, True}

In[22]:= Through[{NumberQ, NumericQ}[MachinePrecision]]
Out[22]= {False, True}

If this is your definition for numeric constants, I should be removed from the list because NumberQ[I] returns True. Generally, I approve the idea that a rule should be set so that we can easily keep pace with every version of Mathematica, however !NumberQ[#] && NumericQ[#]& may be not qualified enough.

@chere005 any ideas?


(Sorry, there's some problem with my browser ...)

@shigma shigma closed this as completed Nov 10, 2018
@shigma shigma reopened this Nov 10, 2018
@chere005
Copy link
Collaborator

  1. All the symbols now in built_in_numeric_constants are NumericQ. Neither Infinity nor Indeterminate satisfy that. I see your point though. What do the other people think?
  2. MachinePrecision is a numerical constant, $MachinePrecision and other symbols is that page are numbers.
In[21]:= Through[{NumberQ, NumericQ}[$MachinePrecision]]
Out[21]= {True, True}

In[22]:= Through[{NumberQ, NumericQ}[MachinePrecision]]
Out[22]= {False, True}

If this is your definition for numeric constants, I should be removed from the list because NumberQ[I] returns True. Generally, I approve the idea that a rule should be set so that we can easily keep pace with every version of Mathematica, however !NumberQ[#] && NumericQ[#]& may be not qualified enough.

@chere005 any ideas?

(Sorry, there's some problem with my browser ...)

I think my comment from 2 days ago covers this. I don't think we need to decide based on NumberQ or NumericQ but rather which symbols we want highlighted similarly because its convenient and helps understand the code

@batracos
Copy link
Collaborator

batracos commented Nov 13, 2018

Let's move Infinity and Indeterminate then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants