Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Friday, May 25, 2012

Fastest way to determine if an integer"s square root is an integer


I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is another integer). I've done it the easy way, by using the built-in Math.sqrt() function, but I'm wondering if there is a way to do it faster by restricting yourself to integer-only domain. Maintaining a lookup table is impratical (since there are about 2 31.5 integers whose square is less than 2 63 ).

Wednesday, May 23, 2012

Wednesday, May 16, 2012

Numerical library for Scala


I'm looking for a library to do numerical computing in Scala (or Java, although something that can use scala functions would be way nicer!) with at least the following capabilities:

Thursday, May 10, 2012

Why Math.min() > Math.max()?


When I type in an array into the parameter of the javascript math minimum and maximum functions, it returns the correct value:

Wednesday, May 9, 2012

Simple statistics - Java packages for calculating mean, standard deviation, etc


Could you please suggest any simple Java statistics packages?



I don't necessarily need any of the advanced stuff. I was quite surprised that there does not appear to be a function to calculate the Mean in the java.lang.Math package...

MathML and Java


I've been doing some research for a mathematical Android related project I'd like to embark upon and I stumbled across for the first time MathML.

Tuesday, February 28, 2012