Thread: Power Function
View Single Post
  #1   Spotlight this post!  
Unread 02-10-2012, 17:23
tyandjel94 tyandjel94 is offline
Registered User
FRC #1647 (Iron Devils)
Team Role: Programmer
 
Join Date: Apr 2012
Rookie Year: 2009
Location: New Jersey
Posts: 14
tyandjel94 is an unknown quantity at this point
Power Function

I was wondering the best way to make a power function for any number. I came up with the conclusion of using Newton's root finding Method which computes is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function. I was able to find that this worked perfectly on a calculator, but it didn't work when you program it. This is because the long, double, and float data types are not long enough. A bigDecimal is needed, but the FRC Java which is Java ME doesn't not have that class. Is there a way to work around this? Thanks a lot.
__________________
-Tyler
Team 1647 Iron Devils
Reply With Quote