btmills / calculator Goto Github PK
View Code? Open in Web Editor NEWCommand-line calculator
License: MIT License
Command-line calculator
License: MIT License
Lines 62 to 64 in 4af6707
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");
}
Line 109 in 4af6707
instead of string 109:
if (prefs.precision < 0)
Line 1277 in 4af6707
instead of string 1277:
while ((ch = getopt(argc, argv, "rm:p:h")) != -1) {
Lines 1282 to 1285 in 4af6707
between the lines 1283-1284:
break;
case 'p':
prefs.precision = atoi(optarg);
break;
case 'h':
usage(argv[0]);
Lines 1289 to 1292 in 4af6707
between the lines 1290-1291:
if(strcmp(str, "help") == 0)
{
usage(argv[0]);
goto get_new_string;
}
I'm Isaac
Here's a patch to add a makefile:
http://pastebin.com/Q3uHp8vb
Dear Brandon,
Could you be so kind to generate .exe
for the rest of us who are mere Windows users w/o compiler?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.