This week's giveaways are in the MongoDB and Jobs Discussion forums. We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line! See this thread and this one for details.
this works fine but only to a certain precision. so i am trying to use BigDecimal. at first i was getting an exception when i divided but i learned i had to specify the rounding. i did that but now i get 2 as an answer
Off topic, but I have two small improvements for you:
Use BigDecimal.ONE and BigDecimal.valueOf(j). The former will definitely reuse an existing object, the latter will probably do so as well. Currently, all values from 0 to 10 are cached; that already saves you up to 10 extra objects per loop.