I sense your sarcasm, but, as you can tell from Zach's honesty, for some people there exists some ambiguity, or even an extreme lack of clarity. So, let's not be so condescending here, huh, ganon? Word.Quote:

Originally Posted bygcn_zelda

Printable View

- 11-29-2004LuckYQuote:

Originally Posted by**gcn_zelda**

- 11-29-2004gcn_zelda
No, I'm serious. I don't know what a modulus is :P

- 11-29-2004Zach L.
When in doubt, MathWorld! :cool:

- 11-29-2004gcn_zelda
Maybe I'll just wait 'til Calculus or whenever we learn about those thingies.

- 11-29-2004linuxdude
do you ever program. You need modulus in a lot of cases.

- 11-30-2004Sang-drax
gcn_zelda:

To calculate 10.2 % .5 you could think of is as repeatedly adding/subtracting 0.5 from 10.2 until to recive a value within 0-0.5.

To calculate x % y, add or subtract y from x until you get a value in the interval [0,y[.

Question:

Why does (pi)! equal approx. 7.68 but

1.3! = 1

Are you using the gamma function or not?

EDIT: Matlab says that gamma(pi + 1) = (pi)! ~= 7.1881

1.3! ~= 1.1667

or

1.3! = 1 if you truncate - 11-30-2004ober
Bug: When calulating something that takes more than 1 second, you need to report it as such or just change it. I did Pi! and it took 7.xxx seconds, but it says 7.xxx msecs.

Other than that, good job. I didn't dig too hard, but it seems fairly solid. - 11-30-2004Sang-draxQuote:

Originally Posted by**Zach L.**

The calculator answers, somewhat cryptically, 5 % 0 = 00 - 11-30-2004Zach L.
It's a perfectly legal algebraic definition. The element 0 generates an ideal [called (0)] which consists of the element 0 alone. So, you can take the modulus with respect to it. You just need the cosets x+(0) and y+(0) to be identical, which only happens when x=y. See my earlier post that goes into this in more detail.

- 11-30-2004LuckYQuote:

Originally Posted by**Sang-drax**

Quote:

Bug: When calulating something that takes more than 1 second, you need to report it as such or just change it. I did Pi! and it took 7.xxx seconds, but it says 7.xxx msecs.

[edit]

In doing more testing of my own I see that I am up against a foe that may conquer me and my measly HugeFloat class. Calculating a number to a floating point power means deadly problems. Currently my exponent function just treats the power like an integer because otherwise I am screwed since things to decimal powers mean strange things. It's possible that it will be a root (e.g., 1 ^ 0.5 = 1 ^ 1/2 = sqrt(1) = 1.4142135623730950488016887242097). If not, what exactly does a power to a floating point value mean? Should I just stick to treating it like an integer always? Should I always check if the exponent can legally be interpreted as a root? I don't know if I'm up for the challenge at this point... Stick a fork in me, I'm done.

[/edit] - 11-30-2004Zach L.
Bah! You know you can't avoid a link to Google. Of course, you can have one to Not Google too. :)

- 12-01-2004PJYelton
>>If not, what exactly does a power to a floating point value mean?<<

If you convert the floating point to a fraction, then x^(y/z) is equal to z'th root of (x^y). For example 4^(2/3) is cube root of 4^2. So 4^(3.16529) is (4^3)*(4^(16529/100000)) which is 64 times the the 100000th root of 4^16529.

Not sure exactly how to do a non repeating infinite float though, such as 4^(pi). - 12-01-2004Sang-draxQuote:

Originally Posted by**LuckY**

G(x) = integral(0,inf) ( t^(x-1) * e^(-t) * dt )

Partial integration shows that G(x+1) = (x+1) * G(x). This combined with G(1) = 1 shows that the gamma function equals the factorial function for integers. The gamma function is a useful generalization of the factorial in some cases.

Quote:

Originally Posted by**LuckY**

Quote:

Originally Posted by**PJ**

a^b where a,b € R is defined as following:

lim{p/q -> b} a^(p/q)

i.e. b is approximated with a rational number which gets closer and closer to the actual real number.

Note that this means that raising a negative number to an irrational number is undefined. There's no way of determining the sign of the result.

This is not easy to implement, I can imagine. :)

I've only done a BigInt class, which is alot easier. - 12-02-2004oberQuote:

Originally Posted by**LuckY**

- 12-02-2004LuckY
Okay a much better operating version is available to anyone who is at all interested in using it or bug-running it. You can get it at http://www.geocities.com/lucky760/hugecalc. I made it dual-threaded so that the damn thing doesn't hang up while running long calculations. Also if it's taking too long for your liking you can just hit ESC or click the X to cancel the current computation. In addition to that I added tool tips to tell what things do and what their keyboard equivalents are. That's the other (and best) thing; you can enter values with your keyboard instead of having to mouse click every number. Finally you can cut/copy/paste stuff using CTRL+Z||C||V and SHIFT+INSERT||DELETE.

Thanks for the help you-all.