Monthly Archives: May 2008

ipfloat &ipfloat::operator +=(const ipfloat &ip){
int carry = 0, i, j, c;
ipfloat temp;
temp = *this;
int expoffset = abs(exp – ip.getExp());
int len = strlen(man);
if(exp<ip.getExp())
{
free(man);
man = (char*)malloc(sizeof(char)*(len+expoffset));
for(c=0; c<expoffset; c++)
man[c] = ‘0′;
exp+=c;
man[c] = ”;
man = strcat(man, temp.getMan());
i = strlen(ip.getMan()) – 1;
j = i;
}
else
{
i = strlen(man) – 1;
j = i-expoffset;
}
for(; i>=0 && j>=0; i–, j–)
{
man[i] = (char)((((int)(man[i] + ip.getMan()[j] – 2*’0′)) + carry)%10) + ‘0′;
carry = (temp.getMan()[i] + ip.getMan()[j] – 2*’0′ + carry >9)?1:0;
}
return *this;
}

Ahh! Code! This is what I’ve been working on the past couple of days. It’s my += operator overload for my arbitrary-precision floating point library. Why did it take so long? Well, I had a malloc problem elsewhere, and malloc problems pop up in weird places, not where the problem actually exists.

In any case, this works for almost everything…There’s still a problem with adding two numbers when the first number has more digits in the exponent, which is what I’m trying to fix. Hopefully I’ll finish the operations before Monday.

Update: Works for all addition! Hoorah!

What does this have to do with lsmsa? Well, it’s my distinction project, it should count for something.

I can’t go to summer school. A lot of people do, and I did last year, but I’m not going to go this year. LSMSA is great, but they only offer so many classes. The only two I could take would be Latin or Shakespeare. Latin would be awesome, but I don’t have room to take Latin II my senior year, so I don’t want to do that, and Shakespeare…eh. Just isn’t very appealing.

What am I doing this summer, you ask? Well, I’m writing this blog, for one. It almost seems silly, writing a blog about Louisiana School without being there, but I will be going back next year…

I’m also working on a distinction project. This is LSMSA’s equivalent to a thesis, really. You choose a topic, research it, compile a presentation (for the whole school), write a paper, the whole shabang. My project doesn’t yet have a title, but it’s generally about Chaos Theory. My main goals:

- Create a program to replace the outdated Mac software for the investigation of chaos (this includes function iteration, graphical iteration, orbit diagrams, the Julia Set, and the Mandelbrot set). I’ll also be enhancing it with Lyapunov exponent stuff, attractors (like the Lorenz), and the Buddhabrot.

- Create an arbitrary-precision floating point library for deep-zoom images of the mandelbrot set. Be able to zoom at least to e-100.

- Create facilities for viewing 3-dimensional/quaternion chaos. (I’ll be using opengl for this bit)

What have I done so far? Well, I’ve got a Mandelbrot set that zooms, a Logistic map that zooms, and the beginnings of an arbitrary-precision library. I hope to finish the library within the week, and then everything else (aside from the quaternion stuff) should be fairly straightforward.

I know that’s really technical, and if you’re reading this blog you probably don’t understand much of it. But I’m really excited about it, and I’m making some good progress. If you finish your project and present it, you graduate “with distinction” which is one of the highest honors at LSMSA.

In addition to this work, I’ll be working at NCPTT as a volunteer for about 20 or so hours a week this summer, starting next Monday. I’ll keep you updated on that, because it _is_ relevant to lsmsa. (You just may not understand why yet)

Peace!

Welcome! You’ve finally made it!

I’m a student at LSMSA – that’s Louisiana School for Math, Science, and the Arts, and this is my blog.

I took it upon myself to blog of my experiences at Louisiana School, so that anyone interested in coming can find out what it’s really like. I’m not going to waste time with a big “about me” spiel, you can just figure it out as you go. Guten Tag!