Code Monkey home page Code Monkey logo

calculator's People

Contributors

btmills avatar flarn2006 avatar tomthebear avatar ygowill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

calculator's Issues

Usage

calculator/calculator.c

Lines 62 to 64 in 4af6707

typedef double number;
void raise(Error err)

between the lines 62-64:

void usage(char * pname)
{
    printf("Usage: %s [option]\n", pname);
    printf("option:\n");
    printf("\t-r\t no print prefix '='\n");
    printf("\t-m N\t maximum token length\n");
    printf("\t-p N\t set precision to X decimal places (-1 = auto)\n");
    printf("\t-h\t this help\n");
    printf("spec command:\n");
    printf("\tget/set\t read or change the value of a setting\n");
    printf("\tdisplay {postfix | tokens} (off/on)\t display the postfix stack | the result of tokenization\n");
    printf("\tmode (radians/degrees) \t evaluation mode of trigonometric functions\n");
    printf("\tprecision (X/auto)\t set precision to X decimal places\n");   
    printf("\thelp\t this help\n"); 
    printf("\tquit\t exit %s\n", pname);    
    printf("operators:\n");
    printf("\t+\t addition\n");
    printf("\t-\t subtraction\n");
    printf("\t*\t multiplication\n");
    printf("\t/\t division\n");
    printf("\t^\t exponent\n");
    printf("\t%\t modulus\n");
    printf("functions:\n");
    printf("\tabs(...)\t absolute value\n");
    printf("\tfloor(...)\t floor\n");
    printf("\tceil(...)\t ceiling\n");
    printf("\tsin(...)\t sine\n");
    printf("\tcos(...)\t cosine\n");
    printf("\ttan(...)\t tangent\n");
    printf("\tasin(...)\t arcsine\n");
    printf("\tacos(...)\t arccosine\n");
    printf("\tatan(...)\t arctangent\n");
    printf("\tsqrt(...)\t square root\n");
    printf("\tcbrt(...)\t cube root\n");
    printf("\tlog(...)\t logarithm\n");
    printf("\texp(...)\t exponentiation (e^x)\n");
    printf("\tmin(...)\t minimum\n");
    printf("\tmax(...)\t maximum\n");
    printf("\tsum(...)\t summation\n");
    printf("\tmean(...)\t mean\n");
    printf("\tavg(...)\t mean\n");
    printf("\tmedian(...)\t median\n");
    printf("\tvar(...)\t variance\n");
}

if (prefs.precision == -1)

instead of string 109:

	if (prefs.precision < 0)

while ((ch = getopt(argc, argv, "rm:")) != -1) {

instead of string 1277:

    while ((ch = getopt(argc, argv, "rm:p:h")) != -1) {

calculator/calculator.c

Lines 1282 to 1285 in 4af6707

case 'm':
prefs.maxtokenlength = atoi(optarg);
}
}

between the lines 1283-1284:

                break;
            case 'p':
                prefs.precision = atoi(optarg);
                break;
            case 'h':
                usage(argv[0]);

calculator/calculator.c

Lines 1289 to 1292 in 4af6707

if (strlen(str) == 0)
goto get_new_string;
if(type(*str) == text)
{

between the lines 1290-1291:

        if(strcmp(str, "help") == 0)
        {
            usage(argv[0]);
            goto get_new_string;
        }

Windows binary

Dear Brandon,
Could you be so kind to generate .exe for the rest of us who are mere Windows users w/o compiler?

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.