Sunday, June 24, 2007

Greatest Common Divisor

Although quite simple, this is one of my favourite new features for 0.8. One will now be able to calculate the greatest common divisor of an unlimited amount of numbers. This way, we can now write

gcd( 675; 633312; -57618; 243 )
27

This is particularly useful if you are adding fractions by hand and they all have different denominators, but has certainly a whole bunch of other applications.

Probability theory

After combinatorics, SpeedCrunch has just been enhanced with its first probability support. This was indeed my favourite mathematics subject when I was a student, so I decided to implement some discrete distributions. So for now we've got three available: Binomial, Hypergeometric and Poisson.

Available for each distribution are functions for probability mass, cumulative distribution, mean and variance. If you usually need some others or find them useful even if you don't use them, please tell us.

I've got many more further plans on these topics for the next SpeedCrunch releases, but I'll leave it like this for 0.8. There are still some open higher priority issues and not much time left to 0.8alpha, so let's focus on bug fixing.

Friday, June 15, 2007

Engineering notation

We developers have been talking about an engineering notation mode in SpeedCrunch for some time. I finally took the time and mood to implement it. Next version will make some people's life a bit easier, I guess. Like most scientific calculators, now we have the following behaviour when in engineering notation mode:

sqrt(sin(pi/3))
930.60485910209959894122e-3

Unlike scientific notation, already supported by the application for some time, the result will always be set so the exponent is a multiple of 3 and the number of integer digits are up to 3. Further support for engineering and inverse engineering functions and buttons will probably be added, so to make the following possible:

0.93060485910209959894122
930.60485910209959894122e-3
eng
930604.85910209959894122e-6
eng
930604859.10209959894122e-9

Maybe we can even add the option to show SI prefixes instead of exponents:

0.93060485910209959894122
930.60485910209959894122 mili
eng
930604.85910209959894122 micro
eng
930604859.10209959894122 nano

Now if I only had SpeedCrunch when I had to study electronics, physics and chemistry...

Saturday, June 09, 2007

Review on FOSSwrite

FOSSwire recently did a short review for SpeedCrunch:



...It is jam-packed full of features and advanced stuff which may come in handy if you’re cracking any big numbers on your desktop...


Read the complete review.

Thursday, May 24, 2007

Combinatorics

So now SpeedCrunch has got combinatorics support. Ariya had already implemented the famous nCr function, so I decided to code its cousin nPr.
I'd realized a nice optimization in Ariya's code. The general definition of nCr is given by
nCr = n! / ((n-r)! r!)
n, r ∈ N0 , r ≤ n (applies all bellow)

But we can indeed reduce very much the number of integer multiplications with the derivation
r ∈ {0, n} ⇒ nCr = 1
r = 1 ⇒ nCr = n
r ∈ ]0, n/2] \ {1} ⇒ nCr = (r+1)n / (n-r)!
r ∈ ]n/2, n[ \ {1} ⇒ nCr = (n-r+1)n / r!

Note that (r+1)n, for instance, is a modern factorial notation equivalent to (n)(n-1)...(r+1). I didn't know about this myself until now. This fasts computation a lot, else the very same calculations would be uselessly repeated.
In the very same way, I found a nice simplification for nPr. The general definition of nPr is given by
nPr = n! / (n-r)!

And again we can do some magic
r = 0 ⇒ nPr = 1
r = 1 ⇒ nPr = n
r = n ⇒ nPr = n!
r ∈ ]1, n[ ⇒ nPr = (n-r+1)n

I spent some minutes getting to this conclusion and then I read it somewhere right after. First I felt a bit frustrated, then I smiled. It's funny to develop this program, it's funny to play maths.

I then realized my old Casio FX-880P can compute up to 69! and SpeedCrunch currently up to 96!, that's good enough (150-digit long integer). Nevertheless, when the user tries to calculate factorials, combinations or permutations with huge parameters the program freezes (even by the calc-as-you-type feature). Maybe it's really a good idea to define an upper limit for those functions input.

How to request a feature

So, you really really like SpeedCrunch but in order to really "leave" the other calculator, you need a feature or two. For example, say you need to have hexadecimal and binary support. Then, perhaps you want to request a feature to be implemented in the next version. How to do this effectively?

First of all, make sure you use the latest version of SpeedCrunch. This is important because SpeedCrunch is constantly improved and often features requested by our users have made it into the release quite fast. You can get the version by choosing menu Help, About. You can compare it against what is shown in the download page (of the website).

Now go to issue list, click on New Issue. Enter a short summary (this is very important!) and type in the description of the feature that you'd like to have. Because this is going to be a feature, not a defect, you should change the label "Type:Defect". Just click on it and choose "Type:Enhancement" from the pop-up menu. Review again your description and if everything is fine, click the Submit button. Your feature request should appear on the issue list now.

It is equally important to search first for existing issues before requesting a feature. Perhaps it is already filed by someone, so you wouldn't want to duplicate. You can always add your own comment to someone's else feature request, perhaps to add your own opinion about it. To search for issue is very simple. From the issue list, enter keyword in the search box and click Search button. You may also want to change Open Issues to All Issues to be able to search resolved issues, in case your feature is already implemented. For example, don't ask for hex and binary support anymore because work on this has been started, as evidenced from issue #13.


And, we're waiting! Your wish is our command....

Wednesday, May 23, 2007

Take-off

From now on, here you can follow what SpeedCrunch developers are working on or even just wondering about the direction it should take. Everybody can leave comments as well, this way providing useful feedback. Please help making this project become the best free multi-platform desktop calculator available by sharing your thoughts. Thank you and enjoy it.