Top "Math" questions

Math involves the manipulation of numbers within a program.

What is JavaScript's highest integer value that a number can go to without losing precision?

Is this defined by the language? Is there a defined maximum? Is it different in different browsers?

javascript math browser cross-browser
How do I calculate square root in Python?

Why does Python give the "wrong" answer? x = 16 sqrt = x**(.5) #returns 4 sqrt = x**(1/2) #returns 1 Yes, I know import math and …

python math sqrt
How to evaluate a math expression given in string form?

I'm trying to write a Java routine to evaluate math expressions from String values like: "5+3" "10-40" "(1+10)*3" I want to avoid …

java string math
How to sum array of numbers in Ruby?

I have an array of integers. For example: array = [123,321,12389] Is there any nice way to get the sum of them? …

ruby arrays math sum
Calculate distance between 2 GPS coordinates

How do I calculate distance between two GPS coordinates (using latitude and longitude)?

math geolocation geometry latitude-longitude geography
Determine Whether Two Date Ranges Overlap

Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap? …

datetime math language-agnostic
Python division

I was trying to normalize a set of numbers from -100 to 0 to a range of 10-100 and was having …

python math python-2.x
What is the behavior of integer division?

For example, int result; result = 125/100; or result = 43/100; Will result always be the floor of the division? What is the defined …

c math c99 c89 integer-division
Python Math - TypeError: 'NoneType' object is not subscriptable

I'm making a small program for math (no particular reason, just kind of wanted to) and I ran into the …

python math sorting in-place
Is there a standard sign function (signum, sgn) in C/C++?

I want a function that returns -1 for negative numbers and +1 for positive numbers. http://en.wikipedia.org/wiki/Sign_…

c++ c math