My current status of Ruby Summer of Code

My project, Decimal, is going well.

I made several milestones for the midterm evaluation, and all of them are almost completely done.

Note that tarball/gem of the latest decimal's doesn't reflect the work in this summer.  If you want to get the latest features now, please checkout it from its subversion repository of trunk.  (I'll solve this issue soon in upcoming release.)

I'll list the milestones up:

Implementing Web pages

First of all, I made a simple web page.

  http://decimal.rubyforge.org/

It might look too simple, but I think this is succinct.  At least it looks even better than the previous.

Now you can find out:
  • How to download / install
  • Latest API documents
  • Existence of mailing lists
  • Coding examples

Mathematical functions implemented

This is the easiest point to understand of current works.

I implemented 24 math functions as Decimal::Math.function(), with
test cases of course.  Most of them are not in BigDecimal but in Float
as ::Math.function().
  • acos(x, n)
  • acosh(x, n)
  • asin(x, n)
  • asinh(x, n)
  • atan(x, n)
  • atan2(y, x, n)
  • atanh(x, n)
  • cbrt(x, n)
  • cos(x, n)
  • cosh(x, n)
  • erf(x, n)
  • erfc(x, n)
  • exp(x, n)
  • frexp10(x) (modeled on frexp)
  • hypot(x, y, n)
  • ldexp10(x) (modeled on ldexp)
  • log(x, n) and log(x, arbitrary_base, n)
  • log10(x, n)
  • log2(x, n)
  • sin(x, n)
  • sinh(x, n)
  • sqrt(x, n)
  • tan(x, n)
  • tanh(x, n)
Additinally, you can calculate pi(n) and e(n).

You can specify Decimal or Integer for x and y, (probably positive) Integer
for n as a "scale," that means n-th decimal places.

Here is the examples:



It's pretty easy, isn't it?

All functions have passed the test cases, and most of specifications are fixed, so I believe you can use those without any fatal difficulties.  Please check it by yourself! (Documentations will be come up soon)

Unfortunately, only 2 functions, gamma and lgamma, still remain to be implemented later.  This is why I've not released as a tarball yet.

Full integration with latest Ruby

Now Decimal integrated with Ruby 1.9.1 and 1.9.2dev.  Since implementations of Bignum are revised in Ruby 1.9.1, you can get better performance if you use Decimal with Ruby 1.9.x.  (Decimal depends Bignum APIs internally)

I recommend 1.9 series, but you can still use Decimal with Ruby 1.8.x of course.

Decimal detects new C APIs that were introduced in 1.9.x, so that it use 1.9-native APIs as much as possible.

Fixing Known bugs

Most of known fatal bugs are fixed, that caused SEGV or returned incorrect values.  There are some other bugs and unfixed specifications yet, but I believe now the Decimal is enough stable to play with, especially comparing its speed with BigDecimal. It's generally faster than old one!

Watch out, the next is coming soon!

If the rest math functions are implemented and tested well, I'll release the state as "Decimal 0.1.0" for tarball and gem.

If you wanna get the latest news about Decimal, I recommend you to
check decimal-talk mailing list, and the feed of this blog.

Stay tuned!

Comments

Popular posts from this blog

Google Summer of Code 2020: The Final Report