Tom Jetland
Joined: 23 Jun 2011 Posts: 31 Location: UK
|
Calculations on large numbers |
Posted: Fri Jul 08, 2011 5:34 am |
|
|
Hi,
I'm getting 3 simultaneous values from a sensor as signed ints with a max value of 650,000 (decimal).
I need to perform the following function on them: -
result = SquareRoot( (a^2) + (b^2) + (c^2))
Just to get started I used floating point numbers, but because I need very high precision and repeatability I know that I'll have to used integers.
How do I deal with numbers in the 64 bit range, i.e. the value I would get when squaring the 650,000?
I've looked around at the GNU big number libraries, but to be honest, I had a job understanding it!
Any input would be much appreciated!
I'm using a PIC18F4620.
Tom |
|