Tag: floating-point

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

1997 Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? 2011-06-21T18:49:55.103

1857 How do I parse a string to a float or int in Python? 2008-12-19T01:52:26.213

1850 Difference between decimal, float and double in .NET? 2009-03-06T11:31:23.103

1392 Why does changing 0.1f to 0 slow down performance by 10x? 2012-02-16T15:58:39.667

1303 How do I check if a string is a number (float)? 2008-12-09T20:03:42.113

1225 Limiting floats to two decimal points 2009-01-18T18:16:41.153

795 Why not use Double or Float to represent currency? 2010-09-16T19:23:57.087

636 How can I force division to be floating point? Division keeps rounding down to 0? 2009-08-12T18:25:15.513

586 Is there a float input type in HTML5? 2013-09-25T17:51:41.123

561 Format number to always show 2 decimal places 2011-05-26T05:22:51.133

551 How to use a decimal range() step value? 2009-01-25T10:20:43.140

536 Why does Math.round(0.49999999999999994) return 1? 2012-03-28T07:30:27.283

459 How to deal with floating point number precision in JavaScript? 2009-09-22T07:34:42.487

456 What is the most effective way for float and double comparison? 2008-08-20T02:09:33.647

425 How to nicely format floating numbers to String without unnecessary decimal 0? 2009-03-31T22:54:29.507

381 How to format a float in javascript? 2009-03-19T09:38:00.993

372 How dangerous is it to compare floating point values? 2012-04-26T13:41:12.947

340 What is the difference between float and double? 2010-03-05T12:48:32.230

331 How to parse float with two decimal places in javascript? 2010-12-14T01:41:30.243

328 How do you round UP a number in Python? 2010-03-01T14:40:04.830

304 What does the constant 0.0039215689 represent? 2014-03-24T21:45:42.513

292 Why does NaN - NaN == 0.0 with the Intel C++ Compiler? 2015-08-25T05:11:50.417

287 Why does changing the sum order returns a different result? 2013-11-06T18:50:17.620

284 Make a float only show two decimal places 2009-02-18T10:25:36.137

284 How to get a random number between a float range? 2011-05-22T13:00:50.053

281 Why are some float < integer comparisons four times slower than others? 2015-05-07T12:11:08.723

280 How to convert float to int with Java 2009-08-18T17:41:05.087

279 How do I print a double value with full precision using cout? 2009-02-16T18:15:18.240

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

245 Float vs Decimal in ActiveRecord 2011-12-15T01:49:52.597

244 Can anyone explain this strange behavior with signed floats in C#? 2010-03-24T15:27:16.543

243 When should I use double instead of decimal? 2009-04-29T16:38:21.710

232 When should I use the "strictfp" keyword in java? 2009-02-05T21:08:34.197

229 C++ random float number generation 2009-03-26T15:49:14.797

229 JavaScript displaying a float to 2 decimal places 2010-07-02T03:21:24.700

229 Why are these numbers not equal? 2012-02-29T23:46:46.600

220 How to convert string into float in JavaScript? 2009-03-13T13:17:20.467

220 What is the rationale for all comparisons returning false for IEEE754 NaN values? 2009-10-14T09:19:17.417

219 round() for float in C++ 2009-01-27T22:06:30.207

217 Double vs. BigDecimal? 2010-08-05T09:39:40.367

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

217 What is the best way to compare floats for almost-equality in Python? 2011-04-08T13:02:41.053

205 Add floating point value to android resources/values 2010-07-19T15:19:59.603

200 Format Float to n decimal places 2011-03-04T15:36:06.170

184 biggest integer that can be stored in a double 2009-12-04T18:12:06.537

184 Float and double datatype in Java 2014-12-22T07:11:39.070

180 Get decimal portion of a number with JavaScript 2010-12-22T18:20:08.763

180 What MySQL data type should be used for Latitude/Longitude with 8 decimal places? 2012-09-19T23:21:32.423

179 Rounding Number to 2 Decimal Places in C 2009-08-27T21:41:57.723

173 Python JSON serialize a Decimal object 2009-12-25T05:00:12.833

171 How do I use floating-point division in bash? 2012-10-04T07:16:56.180

169 Formatting a float to 2 decimal places 2011-06-15T10:31:25.643

166 A fast method to round a double to a 32-bit int explained 2013-06-11T02:01:34.477

162 How do you round a floating point number in Perl? 2008-10-07T13:52:27.710

162 Using bitwise OR 0 to floor a number 2011-09-20T15:47:08.357

154 Why Are Floating Point Numbers Inaccurate? 2014-02-20T00:39:02.033

152 Why does the floating-point value of 4*0.1 look nice in Python 3 but 3*0.1 doesn't? 2016-09-21T14:07:21.237

147 Why does Double.NaN==Double.NaN return false? 2012-01-11T13:02:30.917

146 Is floating-point math consistent in C#? Can it be? 2011-07-13T17:29:55.543

145 Why does adding 0.1 multiple times remain lossless? 2014-09-30T11:59:48.803

138 Why is Double.MIN_VALUE in not negative 2010-10-07T18:44:12.303

132 Which is the first integer that an IEEE 754 float is incapable of representing exactly? 2010-09-25T12:40:34.953

131 How to check if a float value is a whole number 2014-02-05T17:06:10.917

131 Is it possible to get 0 by subtracting two unequal floating point numbers? 2015-02-12T09:55:35.103

129 'float' vs. 'double' precision 2011-02-23T23:21:09.013

126 Formatting floats in Python without superfluous zeros 2010-03-14T00:27:39.187

124 Strange behavior when casting a float to int in C# 2012-01-18T14:04:00.937

124 Why does Clang optimize away x * 1.0 but NOT x + 0.0? 2015-10-22T03:38:39.857

122 Convert floats to ints in Pandas? 2014-01-22T18:42:15.927

120 Retain precision with double in Java 2008-11-27T01:54:03.550

117 What's the difference between a single precision and double precision floating point operation? 2009-04-29T06:30:19.177

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

113 Compare floats in php 2010-06-30T11:51:46.507

110 How to handle floats and decimal separators with html5 input type number 2013-03-08T21:50:39.987

107 Why doesn't C have unsigned floats? 2009-02-04T16:06:58.770

101 round() in Python doesn't seem to be rounding properly 2008-09-11T15:08:09.240

101 Why is SSE scalar sqrt(x) slower than rsqrt(x) * x? 2009-10-06T23:45:32.667

101 In which order should floats be added to get the most precise result? 2011-07-14T19:44:58.943

100 Convert floating point number to a certain precision, and then copy to string 2013-03-07T05:14:46.543

99 0.1 float is greater than 0.1 double. I expected it to be false 2013-10-10T09:40:56.073

97 John Carmack's Unusual Fast Inverse Square Root (Quake III) 2009-08-28T21:43:43.037

97 C++ warning: division of double by zero 2018-07-23T08:09:15.240

95 Why can't I use float value as a template parameter? 2010-02-02T09:50:23.927

94 "f" after number/float in Objective-C/C 2010-03-06T08:12:37.293

93 How do I suppress scientific notation in Python? 2009-03-18T15:27:21.630

93 Floating point vs integer calculations on modern hardware 2010-03-31T03:15:13.560

92 Cast to int vs floor 2010-07-21T14:26:31.917

92 Why is NaN not equal to NaN? 2012-04-05T18:43:01.573

90 How can I improve performance via a high-level approach when implementing long equations in C++ 2015-10-02T12:32:47.697

88 How many double numbers are there between 0.0 and 1.0? 2010-06-05T02:51:23.187

88 How to compare two floating point numbers in Bash? 2011-12-28T09:27:45.660

87 Do any JVM's JIT compilers generate code that uses vectorized floating point instructions? 2012-05-28T12:48:21.910

86 PHP String to Float 2009-01-26T21:32:22.290

86 Truncating floats in Python 2009-04-23T22:56:44.380

86 What's the difference between hard and soft floating point numbers? 2010-07-23T19:00:47.527

85 What's the closest double to 1.0, that isn't 1.0? 2016-08-06T07:52:36.833

84 Convert String to float in Apple's Swift 2014-06-06T15:35:44.197

82 Is it safe to check floating point values for equality to 0? 2009-01-27T20:50:14.620