duckduckgo / zeroclickinfo-goodies

DuckDuckGo Instant Answers based on Perl & JavaScript
https://duckduckhack.com/
Other
980 stars 1.76k forks source link

Calculator: Add support for advanced calculations #1187

Closed tagawa closed 7 years ago

tagawa commented 9 years ago

Add the ability to solve e.g. 10!, 20nCr8, etc. as well as equations.

Suggestion source: https://duck.co/forum/thread/13748/calculator-improvements


IA Page: https://duck.co/ia/view/calculator

mintsoft commented 9 years ago

@tagawa 20nCr8 should probably be handled by: https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Combination.pm already I think

moollaza commented 9 years ago

We're currently contemplating how we want the calculator to work. There is a Spice PR which will bring a API powered calculator from Symbolab.com it could be used for just about all calculations, but we need to keep a backend (Perl) calculator for the /html and /lite versions of the site.

The current calculator isn't very modular and so we've created several niche "calculation" IA's which I'd like to avoid.

As @mintsoft knows, we have a similar problem with handling conversions.

One idea I had was to leverage Math.js and Node as it supports both Math and Conversions, and it's extensible.

tagawa commented 9 years ago

Thanks for the comments @mintsoft and @moollaza. I agree, there's practically no limit to the features/complications that could be added so a re-think is probably best.

mintsoft commented 8 years ago
mintsoft commented 8 years ago

@tagawa I think this can be closed once #1927 is merged?

tagawa commented 8 years ago

@mintsoft Agree, and if there are any further requests they can be individual new issues.

moollaza commented 7 years ago

Closing.

The new calculator supports factorials.

nCr can be added to the Combination IA. (Will make a new issues)

Equations are handled by the Symbolab Spice.