Coder Social home page Coder Social logo

calc's People

Contributors

thomseddon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

calc's Issues

Trig support

Sin/Cos/Tan

This could follow on nicely from Issue 1, let's see.

Cannot calc 0+1

Calc does not correctly parse expressions that start with a zero, like 0+1.
To correct this I've added one clause && strStart == str to the if below

int main(int argc, char *argv[])
{
   ...
   /* Tokenise */
      } else if ((number = strtold(str, &str)) == 0.0L && (number = strtoconst(str, &str)) == 0.0L && strStart == str) {
         /* NaN */                                                  
         insertToken(currentScope, OP, normalise(*str), 0);         
      ...

If no number is recognized by strtold(), the return value is 0.0L and the complete string remains unrecognized (strStart == str). An actual number of 0 will increase str by contrast and thus skip /* NaN */ and correctly proceed to /* Number */.

Improve equation input

Having to wrap special characters in quotation marks is really annoying, come up with something smarter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.