Download Latest Version crunch_beta-0.3.7.zip (37.5 kB)
Email in envelope

Get an email when there's a new version of Note Cruncher

Home / Transport
Name Modified Size InfoDownloads / Week
Parent folder
FFT_Test.zip 2011-12-24 87.7 kB
crunch-0.3.2.zip 2011-08-11 35.0 kB
README.txt 2011-06-25 5.9 kB
main.c 2011-06-25 14.9 kB
fastcalc.layout 2011-06-25 450 Bytes
fastcalc.depend 2011-06-25 272 Bytes
fastcalc.exe 2011-06-25 12.8 kB
fastcalc.cbp 2011-06-25 895 Bytes
crunch.h 2011-06-25 1.6 kB
crunch.c 2011-06-25 7.4 kB
Changelog.txt 2011-06-25 612 Bytes
Totals: 11 Items   167.5 kB 0
CRUNCH README
-----------------------------------------
*************************************************************
This is in the directory called "Transport". This is where I pass files back and forth to myself.  This may contain interesting code, but due to the printing of debug messages and incomplete functionality of features under development, it is not considered a release, nor will the program operate as you might expect.  This is the general block of code I will be moving into git soon.

**************************************************************

This calculator spawned from a desire to have a commandline calculator that starts instantly and doesn't require you to type the full word "quit" to quit.  Simply start the program, do a few calcs, and 'q' is enough to get out.  The main goal is to make this calculator cross-platform with dependencies only on c standard libraries, and make it fast starting and quitting.  

The goal is to fill a place between fully-featured programs such as Octave/Matlab/Maple/(name of huge math program here) and simple GUI calculators.  It is my opinion GUI's get in the way of efficiency.  When features increase, usefulness decreases.

There may be other CLI calculators out there that do what I want, but I have been left unsatisfied whith what I have tried so far--either it is too simple, or it is too cumbersome, so... why not make yet-another-cruncher exactly tailored to my preferences?

As can be seen, this is the proverbial re-invention of the wheel with a nich use, but since I'm doing it for fun as well as educational purposes, I may as well share it with whoever finds it useful.  Enjoy!

YADA YADA
---------
This is the "WOL" Wide Open License software.  You can take it, do anything with it, use it in commercial and non-commercial projects alike, assimilate it into larger projects, use it for educational purposes, or whatever else constitutes as software use, copying and distribution -- But I must attach some stipulations to cover my @77:
This software comes with NO WARRANTY of any kind, implied or otherwise.
I am not responsible for anything you do with it.  Once you take the code, you assume responsibility for all consequences related to its use.
I am not responsible for anything it does to you.  I have personal incentive to make it as accurate and bug-free as possible, but I have no obligation to do so.

BUILDING AND EXECUTING
----------------------
Right now it does not support parentheses or proper order of operations, but code is in place so I can slowly chip away at it.  

I have included the Windows executable "fastcalc.exe" which you can simply download and double-click to run, should be good to go there.
Copy it to whatever folder you want.  You may also wish to make a shortcut and assign an icon to it.

For Linux, I will try to keep a binary up-to-date in the corresponding release directory, but I recommend building from source...which is really really simple for a small 1-file program without dependencies on any libraries other than standard C libs (this is one of the goals of the project). Just make sure you have gcc installed (for command below, search your package manager for g++ and install associated packages until the command works).

Just copy main.C into whatever directory you want to and do the following from that directory:
$ g++ main.c -o crunch

//if you feel the need to add compiler options, feel free, but at this time the program is so simple I don't see much need for any optimisation
//However, you may find some other options need to be included to make it compile successfully on your system.

If you want to launch it without the full directory name,  you want it in your $PATH, then as root (or using sudo),

# cp crunch /usr/sbin

or similar directory in your $PATH


Simply execute the file.

GENERAL USAGE
-------------

Once it's running, things are very straight-forward.  Right now it supports the following operations:
Operator	Function
--------	--------
+		ADD
-		SUBTRACT
*		MULTIPLY
/		DIVIDE
%		MODULO (Performs floating-point modulo, so it's good for both integers and the rest of the real numbers)
^		POWER (Example: 2^4 is 2 raised to the 4rth power)

Invoke "M*10^N" notation in the folowing manner:
MeN 
For Example, to represent 10 times 10 to the 6th,  "1e6" is the proper notation.  This is pretty standard, so not likely anybody will have trouble here.

The constant 'e' is also supported, for example, e^4 will return e raised to the power of 4.

ORDER OF OPERATIONS
-------------------
Proper mathematical order of operations is not yet supported:

By default it executes operations from left to right and accumulates as it goes, for example:
[ crunch ] $ 3 + 4 + 2/6

Will actually be evaluated in this manner:
(3 + 4 + 2)/6

Another example:
[ crunch ] $ 2/7 + 5 * 3

Will be evaluated like this:
((2/7) + 5)*3

I will plan to change this in future releases, but for now it's very primitive.

LOG FILES
---------
You can save your session to a text file by the following:
[crunch] $ log on  //This will turn on the log
[crunch] $ log off //stop recording to text file
[crunch] $ log on f //specify a different file name than the default

Default file is "crunch.log" saved in the directory from which the program is executed.  

FINAL NOTES
-----------
There is a CodeBlocks project file in the directory for anybody using Code::Blocks IDE.  If any collaborators join, I will not require any dependency on the Code::Blocks project and it will become a purely GNU & make style project with no dependency on fancy programs for building.  Then you could use text editor or IDE of your choice.

Comments, Suggestions and collaboration are all welcome:
ryjobil@gmail.com

REVISIONS
---------

Initial Release: June 13, 2011
Update: June 15, 2011

 
Source: README.txt, updated 2011-06-25