I'm trying to convert one range of numbers to another, maintaining ratio. Maths is not my strong point.
I am reading this book (NLTK) and it is confusing. Entropy is defined as: Entropy is the sum of the proba
I'm trying to write a Java routine to evaluate math expressions from String values like: "5+3" "10-40" "(
I'm thinking in particular of how to display pagination controls, when using a language such as C# or Jav
This is the best algorithm I could come up. def get_primes(n): numbers = set(range(n, 1, -1)) primes
Is there a faster way than x >= start && x <= end in C or C++ to test if an integer is between t
How do I calculate distance between two GPS coordinates (using latitude and longitude)?
I want a function that returns -1 for negative numbers and +1 for positive numbers. http://en.wikipedia.org/wi
What is the difference between Math.Floor() and Math.Truncate() in .NET?
I have the following JavaScript syntax: var discount = Math.round(100 - (price / listprice) * 100)
Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >&
I have an array of integers. For example: array = [123,321,12389] Is there any nice way to get the sum of
Today I needed a simple algorithm for checking if a number is a power of 2. The algorithm needs to be: Simpl
I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Tayl
I can't get my head around this, which is more random? rand() OR: rand() * rand() I´m finding it a
A question I got on my last interview: Design a function f, such that: f(f(n)) == -n Where n is a 3