Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
Square Roots? — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
General Discussion
Square Roots?
askobac
Posts:
1
2008-03-11 05:33
edited 2008-03-11 06:23
in
General Discussion
Is there a way to do square roots on the javelin stamp without getting one of the floating point coprocessor chips?
Comments
Peter Verkaik
Posts:
3,956
2008-03-11 06:23
edited 2008-03-11 06:23
My class UnsignedIntMath provides a method usqrt()
that returns the root of x in I.F format in an integer,
meaning the top 8 bits contain the integer value and the lower
8 bits contain the fraction, eg. usqrt(x) = I + F/256
regards peter
java
java
UnsignedIntMath.java
13K
java
java
UnsignedIntMath_test.java
2K
UnsignedIntMath.java
12.7K
UnsignedIntMath_test.java
2.4K
Sign In
or
Register
to comment.
Comments
that returns the root of x in I.F format in an integer,
meaning the top 8 bits contain the integer value and the lower
8 bits contain the fraction, eg. usqrt(x) = I + F/256
regards peter