The current program I have been working on has been returning a lot of errors lately.
This is the standard error message I get:
Exception in thread "main" java.lang.ArithmeticException: / by zero
at Projector.binomExpansion(Projector.java:24)
at Projector.getOdds(Projector.java:43)
at Projector.main(Projector.java:54)
Type 'getOdds()'. You will be prompted to enter data.
The binomial expansion of (0.5 + 0.5)^3 is:
0.1250.60.5The binomial expansion of (0.6 + 0.5)^1000 is:
The following is very odd because I should be getting an arithmetic exception. It may be that the computer doesn't understand factorial expressions. I may have to teach the computer that 0! = 1. The actual recursive program that calculates the factorials in my program does not have the condition for 0!. It's quite odd that the program worked before I tried to implement the binomial expansion as part of another method, but now the binomial expansion doesn't work.
I was also having trouble with some static call methods but then those were fixed.
I guess that's all. If adding the extra condition to the factorial statement doesn't work... I will have to try something else.
No comments:
Post a Comment