Top "Math" questions

Math involves the manipulation of numbers within a program.

Calculating distance between two points (Latitude, Longitude)

I am trying to calculate the distance between two positions on a map. I have stored in my data: Longitude, …

sql sql-server tsql math sql-server-2008-r2
What is the fastest factorial function in JavaScript?

Looking for a really fast implementation of factorial function in JavaScript. Any suggests?

javascript math factorial
How can I use numpy.correlate to do autocorrelation?

I need to do auto-correlation of a set of numbers, which as I understand it is just the correlation of …

python math numpy numerical-methods
Truncate Two decimal places without rounding

Lets say I have a value of 3.4679 and want 3.46, how can I truncate to two decimal places that without rounding …

c# math rounding
javascript: calculate x% of a number

I am wondering how in javascript if i was given a number (say 10000) and then was given a percentage (say 35.8%) …

javascript math
Evaluating string "3*(4+2)" yield int 18

Is there a function the .NET framework that can evaluate a numeric expression contained in a string and return the …

c# string math numeric evaluate
How can I use "e" (Euler's number) and power operation in python 2.7

How can i write x.append(1-e^(-value1^2/2*value2^2)) in python 2.7? I don't know how to use power operator and …

python math equation exp
What's the best practice to round a float to 2 decimals?

I'm using eclipse + Android SDK. I need to round a float value to 2 decimals. I usually use the next "trick" …

java android math
How to resolve a Java Rounding Double issue

Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*…

java math rounding
Writing your own square root function

How do you write your own function for finding the most accurate square root of an integer? After googling it, …

algorithm function math square-root newtons-method