Tag: math

2402 Is floating point math broken? 2009-02-25T21:39:02.343

1282 Fastest way to determine if an integer's square root is an integer 2008-11-17T13:43:21.907

1026 Determine Whether Two Date Ranges Overlap 2008-11-28T14:48:35.643

1022 Easy interview question got harder: given numbers 1..100, find the missing number(s) 2010-08-16T10:26:58.180

837 Designing function f(f(n)) == -n 2009-04-08T21:04:18.170

830 What is JavaScript's highest integer value that a number can go to without losing precision? 2008-11-20T22:47:54.100

825 Understanding "randomness" 2010-10-18T03:40:52.267

746 Calculate distance between two latitude-longitude points? (Haversine formula) 2008-08-26T12:50:45.647

742 How do I determine whether my calculation of pi is accurate? 2013-01-11T17:15:32.447

727 Integer division with remainder in JavaScript? 2010-11-19T18:53:13.800

661 Divide a number by 3 without using *, /, +, -, % operators 2012-07-27T19:34:31.463

629 How can I check for NaN values? 2009-06-03T13:19:54.927

527 How to sum array of numbers in Ruby? 2009-10-08T16:04:57.870

504 How to check if a number is a power of 2 2009-03-01T19:01:29.753

381 Difference between Math.Floor() and Math.Truncate() 2008-08-01T00:59:11.177

367 Fastest way to determine if an integer is between two integers (inclusive) with known sets of values 2013-06-13T19:21:42.930

345 Is there a standard sign function (signum, sgn) in C/C++? 2009-12-14T22:27:15.443

333 What is the difference between '/' and '//' when used for division? 2008-10-08T17:16:35.830

324 JavaScript math, round to two decimal places 2013-04-02T11:18:30.403

320 Fastest way to list all primes below N 2010-01-14T23:40:27.110

315 What is "entropy and information gain"? 2009-12-07T11:54:32.990

304 Calculate distance between 2 GPS coordinates 2008-12-13T22:12:33.697

285 What is the standard way to add N seconds to datetime.time in Python? 2008-09-19T07:19:36.320

283 How to round up the result of integer division? 2008-08-20T13:27:40.210

269 Evaluating a math expression given in string form 2010-08-06T09:53:30.510

263 Why can't decimal numbers be represented exactly in binary? 2009-07-06T20:17:12.403

258 Too many 'if' statements? 2014-03-19T09:24:55.083

233 Calculating arithmetic mean (one type of average) in Python 2011-10-10T17:19:17.340

228 How can I ensure that a division of integers is always rounded up? 2009-05-28T14:37:42.293

218 How to determine if a point is in a 2D triangle? 2010-01-12T14:25:49.173

217 Why is division in Ruby returning an integer instead of decimal value? 2011-03-31T15:59:29.237

216 What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs? 2009-09-04T16:45:58.510

215 The most efficient way to implement an integer based power function pow(int, int) 2008-09-19T12:30:30.620

215 How to determine if a list of polygon points are in clockwise order? 2009-07-22T14:24:33.353

212 How does C compute sin() and other math functions? 2010-02-17T22:22:49.463

207 How can I divide two integers to get a double? 2009-03-19T04:09:22.890

204 Convert a number range to another range, maintaining ratio 2009-05-30T05:48:22.420

198 How can I round down a number in Javascript? 2009-09-16T23:06:42.320

198 Fast ceiling of an integer division in C / C++ 2010-04-30T14:16:53.597

197 How do I calculate a point on a circle’s circumference? 2009-05-08T13:57:13.840

197 JavaScript % (modulo) gives a negative result for negative numbers 2010-12-17T03:55:33.870

195 Mapping two integers to one, in a unique and deterministic way 2009-05-28T07:30:10.440

194 How to scale down a range of numbers with a known min and max value 2011-03-14T05:07:03.670

186 What are the mathematical/computational principles behind this game? 2011-06-04T23:54:53.423

182 How can I specify the base for Math.log() in JavaScript? 2010-06-10T23:30:55.940

179 Is log(n!) = Θ(n·log(n))? 2010-01-19T17:15:34.773

176 Circle line-segment collision detection algorithm? 2009-07-02T09:15:10.203

171 Rounding BigDecimal to *always* have two decimal places 2013-03-26T17:09:58.020

170 Why prefer two's complement over sign-and-magnitude for signed numbers? 2009-07-14T13:15:08.303

169 Algorithm to find Largest prime factor of a number 2008-08-22T19:35:50.513

169 Safest way to convert float to integer in python? 2010-08-02T12:20:20.617

169 Generate a random point within a circle (uniformly) 2011-04-29T21:27:50.357

166 Unique (non-repeating) random numbers in O(1)? 2008-10-12T20:34:22.297

160 What is the behavior of integer division? 2010-08-30T17:41:18.080

153 How do I calculate the normal vector of a line segment? 2009-08-07T08:35:36.627

153 Why do Python's math.ceil() and math.floor() operations return floats instead of integers? 2011-12-20T22:22:09.130

152 latitude/longitude find nearest latitude/longitude - complex sql or complex calculation 2010-02-10T03:21:59.687

150 Mod of negative number is melting my brain 2009-07-04T20:22:43.960

149 How to make rounded percentages add up to 100% 2012-11-20T22:38:55.757

146 Why does C++ rand() seem to generate only numbers of the same order of magnitude? 2013-06-20T09:18:54.977

144 How does the HyperLogLog algorithm work? 2012-09-08T00:28:21.063

143 What is the method for converting radians to degrees? 2008-09-25T20:40:52.637

143 Performance of Java matrix math libraries? 2009-02-09T19:12:03.783

136 Least common multiple for 3 or more numbers 2008-09-29T04:33:16.087

136 Sort points in clockwise order? 2011-08-08T21:57:30.457

135 How to get mathemical PI constant in Swift 2014-10-12T10:16:18.757

133 Algorithm to detect intersection of two rectangles? 2008-09-22T15:15:53.397

128 How do you calculate the average of a set of circular data? 2009-01-29T14:15:18.843

127 How to test if a double is an integer 2012-03-27T22:17:25.807

123 Java Round up Any Number 2010-12-27T18:00:03.220

123 Calculate the center point of multiple latitude/longitude coordinate pairs 2011-07-12T21:11:17.493

120 How to calculate an angle from three points? 2009-07-31T07:55:04.800

120 Mod in Java produces negative numbers 2011-03-21T23:36:18.217

117 Is mathematics necessary for programming? 2008-10-01T12:35:37.517

117 What is the best algorithm for checking if a number is prime? 2009-11-26T03:30:49.273

117 What does gcc's ffast-math actually do? 2011-09-14T17:45:30.233

114 Math.random() explanation 2011-11-01T02:11:10.697

113 Python division 2010-06-02T14:33:00.163

112 Is there a math nCr function in python? 2011-02-09T05:51:13.150

107 Possible Loss of Fraction 2009-06-30T01:21:50.843

106 How to convert number to words in java 2010-10-12T05:41:57.913

104 How to tell whether a point is to the right or left side of a line 2009-10-13T14:10:35.173

104 How to round a number to significant figures in Python 2010-08-05T00:48:04.977

104 Remove insignificant trailing zeros from a number? 2010-08-31T20:00:59.797

103 Why use softmax as opposed to standard normalization? 2013-06-19T09:20:26.780

101 Why isn't int pow(int base, int exponent) in the standard C++ libraries? 2010-03-07T23:25:39.337

100 How do I calculate square root in Python? 2012-03-07T02:48:51.723

100 What's the difference between “mod” and “remainder”? 2012-12-03T12:45:42.927

98 Fast permutation -> number -> permutation mapping algorithms 2009-10-01T19:52:24.470

97 How do Trigonometric functions work? 2008-12-05T20:49:25.067

96 How to convert latitude or longitude to meters? 2009-03-12T17:38:44.047

96 Why must a nonlinear activation function be used in a backpropagation neural network? 2012-03-20T06:06:22.090

96 Why does i = i + i give me 0? 2014-06-11T22:12:03.797

94 What's the best practice to round a float to 2 decimals? 2012-01-18T13:57:59.467

93 Is it safe to assume a GUID will always be unique? 2010-06-04T20:30:26.163

92 Best way to represent a fraction in Java? 2009-01-23T21:07:59.527

92 What is the fastest way to compute sin and cos together? 2010-04-21T14:05:53.070

91 Evenly distributing n points on a sphere 2012-03-07T11:39:06.463

90 Why does Decimal.Divide(int, int) work, but not (int / int)? 2009-06-25T10:33:12.343