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

Allow different forms of operands #1251

Closed
leduyquang753 opened this issue May 28, 2020 · 14 comments
Closed

Allow different forms of operands #1251

leduyquang753 opened this issue May 28, 2020 · 14 comments

Comments

@leduyquang753
Copy link

leduyquang753 commented May 28, 2020

Problem statement
Currently the calculator only allows the "computer" forms of operands – + - * / – for input, and "mixed computer and US" forms – + - × ÷ – for display, while in reality, there are many other forms used.

Evidence or user insights
For example in Vietnamese academy, these forms are used:

  • Addition: + (plus)
  • Subtraction: – (en-dash)
  • Multiplication: . (full stop)
  • Division: : (colon)

In case someone might argue they have never seen such a weird case of the full stop as multiplication, here is a shot from a high-school physics textbook:

image

Proposal
Users should be able to input expressions and see the interface (calculator buttons, calculation results) in their preferred form.

Goals

  • Allow input to have other forms of operands, for example multiplication can be . · × *.
  • Allow customization of the interface to have the operands in a chosen form.

Non-goals
(None.)

Possible problems and solutions
The operand forms chosen can coincide with each other, for example . as both the thousand separator and the multiplication sign.

We can check those in the code and automatically fix by falling back to the default, for the example
above the multiplication sign can fall back to ×.

If #153 (Support both . and , as decimal separator when entering numbers) is implemented, the dot can be ambiguous.

We can make an option to not enable the "both dot and comma are decimal separators" feature and let the user use the dot as multiplication sign. If the user keeps that enabled anyway, we fall back as the problem above when they also happen to attempt to set . as multiplication.

The calculator button icons are from a custom icon assets font.

We can let those icons originate from Segoe UI light or the like.

Low-fidelity concept
Mockup configuration: Vietnamese academic.

  • Decimal separator: comma.
  • Thousand separator: space.
  • Operands: + – . : ^ # for addition, subtraction, multiplication, division, exponentiation, root extraction.

Input

  • When the user has the comma as decimal separator, the user can for example type . for multiplication, : for division.
  • Pasting the expression 16,3 + 28,7 . 1594 – 18 : 2^2 + 3#8 (English reading: Sixteen point three plus twenty-eight point seven times one thousand five hundred ninety-four minus eighteen divided by two squared plus the third root of eight) into the scientific view should yield 45 761,6 (English reading: Forty-five thousand seven hundred sixty-one point six).

Interface

  • The user can make the calculator buttons appear as + – . ::
    image

  • The user can make the result appear in the chosen forms:
    image

Requested assignment
If possible, I would like to (try to) implement this.

@MicrosoftIssueBot
Copy link
Collaborator

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

@leduyquang753 leduyquang753 changed the title The calculator should allow different forms of operands Allow different forms of operands May 28, 2020
@KillyMXI
Copy link

KillyMXI commented May 28, 2020

Citation is needed for whether they actually use full stop (.) as a mathematical operation.

Please refer to this summary of dot symbols in Unicode: https://tex.stackexchange.com/a/70462

Before proven otherwise, I see this as a lazy replacement. Things of this kind are usually done when people don't know how to type the right character or given no convenient tool to do so.

The provided picture can as well show such misuse by concrete educational material authors.

Note:

In Russia, colon (:) and dot (⋅) (NOT full stop) are commonly used in handwriting for mathematical operations.

To make things more complicated, in some countries a dot (·) can be used as a decimal separator.

(Since it is all about handwriting, the characters I've put above as examples - can't be exact and just here for visual reference. With existing tools, people are more likely to first find the middot (·) for any purpose. And more importantly, since it is more about handwriting - it is less relevant in digital world. The only use case is pasting expressions from type-setted resources, which seems rather insignificant.)

@leduyquang753
Copy link
Author

leduyquang753 commented May 28, 2020

Citation is needed for whether they actually use full stop (.) as a mathematical operation.

From Full stop on Wikipedia:

In countries that use the comma as a decimal separator, the point is sometimes found as a multiplication sign; for example, 5,2 . 2 = 10,4.

You can go to any middle or high school in Vietnam and see the multiplication signs as full stop in mathematics, physics, chemistry,... textbooks. Isn't that a proof that it is actually used somewhere? The explanation of "lazy replacement" doesn't deny that fact. You can't just cover Vietnam on the world map and say it doesn't exist, can you?

Things of this kind are usually done when people don't know how to type the right character or given no convenient tool to do so.

Yes, there is no · readily available on the keyboard, only .. However, people who wrote the physics textbook I took an image above were able to enter fractions, exponentiation and stuff, so I don't think the . is a result of technical limitation or laziness.

And as I have even dedicated a section of Possible problems and solutions, the choice of operands from the user does not pose a problem here. Please have a look at it. The user can choose any weird combination of signs as long as they don't coincide, which the code can tell and fix.

Finally, if middle dots were used, then the issue still stands: the calculator doesn't accept that.

@KillyMXI
Copy link

KillyMXI commented May 28, 2020

You can't just cover Vietnam on the world map and say it doesn't exist, can you?

That's not what I'm trying to do.

For a person not familiar with particular country culture, the motivation for your proposal seemed weird and possibly misguided. So I asked for more backing.

For the issue you linked, I was trying to formulate a parser logic that might incorporate different ways to express separators. That was put on hold because there is a roadblock no one seems to be interested to lift. (There is a first draft I was going to rewrite.)

This proposal might be a natural extension of that. But all together it will require to rewrite the parser from ground up. I'll be happy if this adds weight to that and makes it more likely to happen.

@miloush
Copy link

miloush commented May 28, 2020

I have definitely seen dots as multiplication in my country as well but I side with that being a lazy typography that shouldn't be encouraged. In your example, there is also (21.1) string - do you expect that to be interpreted as multiplication or decimal point?

You argue that · is not readily available on the keyboard, but neither is en-dash that you use for subtraction. Again I would guess that's just another indifference of the author/editor to autocorrections of the software, or do you explicitly enter en-dashes for subtraction?

Either way, I don't think this issue is about any specific country. The issue is, should the user be able to choose/create a set of operators for input and display. I am not aware of any other software that let's you do that, and I am currently not convinced there is a use case for it. You have shown that a document with a specific notation exists, but not that that's what people are trying to input in the calculator. What expression did you try to paste to the calculator last time that hit this problem?

@leduyquang753
Copy link
Author

leduyquang753 commented May 28, 2020

In your example, there is also (21.1) string - do you expect that to be interpreted as multiplication or decimal point?

Neither. It's an identifier for formulas used in the book. You can ask the same question for your US's similar uses.

image

What expression did you try to paste to the calculator last time that hit this problem?

-30000000000:30000000. I had to use my own app for this thing which allows having different forms of the same operand in the expression.

@miloush
Copy link

miloush commented May 28, 2020

It's an identifier for formulas used in the book

The calculator does not know that.

-30000000000:30000000

I would be much more willing to support : in the pasted text as a character for division than having a whole UI for customizing the input and display of operators, provided that 1) it is not used by the current regional settings as a separator, and 2) people are willing to commit there will never be a support for : operator different than division, such as ratios/fractions.

The problem with . is that it fails 1) in most cultures, including Vietnamese. If you paste a number with a full stop and the regional settings say full stop is a digit grouping symbol, then I see no justification to treat it as multiplication.

@leduyquang753
Copy link
Author

leduyquang753 commented May 28, 2020

The calculator does not know that.

Yes and I and other students are not the computer, thus we know that we are not going to paste it into the calculator.

I would be much more willing to support : in the pasted text as a character for division than having a whole UI for customizing the input and display of operators

Actually I don't feel like interface customization is a must as well, but making the user feel right at home rather than in the US is still a good thing to head to.

provided that 1) it is not used by the current regional settings as a separator, and 2) people are willing to commit there will never be a support for : operator different than division, such as ratios/fractions.

The user can be silly and make : the thousand separator, no problem: We no longer see : as division anymore and fall back to ÷, as stated in Possible problems and solutions in my original post. The user decided to override, so obey.

The problem with . is that it fails 1) in most cultures, including Vietnamese. If you paste a number with a full stop and the regional settings say full stop is a digit grouping symbol, then I see no justification to treat it as multiplication.

Just like above, if the dot is used for digit grouping we respect that and don't treat it as multiplication.

@KillyMXI
Copy link

if the dot is used for digit grouping we respect that and don't treat it as multiplication

The biggest problem with this is how to explain it to a machine. Things obvious to us humans might get hairy once we try to define formal logic for them.

And seeing it dispensable and a possible source of confusion even at the origin makes the added complexity less justifiable.

(I keep the parsing problem in the list of things I want to address in my own way, and this issue adds new perspective to it. But I can't say the same for Microsoft.)

@miloush
Copy link

miloush commented May 28, 2020

The biggest problem with this is how to explain it to a machine.

What is the problem in that? Let's say you have list of hardcoded symbols for each meaning/operator (I am just making this up on the go), you look at the regional settings, that gives you decimal separator, thousands separator, list separator and even the symbol for negative numbers, you apply those and remove them from all the lists. Then as you find a symbol, if it isn't in any of the lists or if it is in multiple lists, you throw an error.

If you end up in parsing error and you have a good will, you can try few other cultures, but I would always try them as a set, not trying to figure out each symbol individually. There is a few favourite cultures you should give it a try with - the formatting one, the display one, neutral one, perhaps the locale and if you feel very generous then the input ones.

I think a bigger problem is to explain it to the user, not to the machine.

@leduyquang753
Copy link
Author

In my own implementation I use this strategy:

  1. Map each supported character to an operand.
  2. Put the decimal seperator, and thousand separator to the higher processing priority (i.e. detect and process them first) than the operands.

Thus, if the dot is mapped to multiplication but it is already defined as either of the separators, the code will naturally ignore the multiplication and rather treat it as the expected separator.

@ghost
Copy link

ghost commented Jun 2, 2020

This pitch looks like it has everything it needs for review. In the meantime, we'll keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development.

@ghost
Copy link

ghost commented Jul 21, 2020

Thanks again for submitting your idea! However, after reviewing this pitch more closely, we do not believe it is a great fit for the product at this time. Thank you for your contribution to Calculator!

@ghost ghost removed the needs pitch review label Jul 21, 2020
@ghost ghost closed this as completed Jul 21, 2020
@grochocki
Copy link
Contributor

Thanks for the detailed feature pitch (and for all the great conversation in this thread)! We've spent some time digging into alternative notion for multiplication and division.

In regards to division, the ISO standard for mathematical notation specifies the colon : should be used for ratios:

[T]his symbol "should not be used" for division.

There is an uncited mention of full stop being used for multiplication. The center dot (or interpunct) is definitely used as a multiplication sign, and in some cases, the symbols may be swapped:

In situations where the interpunct is used as a decimal point, the multiplication sign used is usually a full stop (period), not an interpunct.

This is consistent with some evidence to support full stop being used historically:

In the UK prior to 1969 these two characters were reversed in role. In older British publications, 2·3 typically meant two and three-tenths, where as 2 . 3 meant two times three. Indian publications used to do this as well.

That being said, these symbols are also not listed as standard notation in various articles covering arithmetic, algebra, or in lists of mathematical symbols (or the ISO standard), nor do they appear to have widespread adoption in academia/sciences.

Given this, and because of the complexity of supporting this in the parser and the challenge of exposing UI customization options to users in a simple, straightforward way, we do not think this is a great fit for the product at this time. Thanks again for your contribution!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants