OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Various math-related utility functions. | 5 // Various math-related utility functions. |
6 | 6 |
7 class Math2 { | 7 class Math2 { |
8 /// Computes the geometric mean of a set of numbers. | 8 /// Computes the geometric mean of a set of numbers. |
9 /// [minNumber] is optional (defaults to 0.001) anything smaller than this | 9 /// [minNumber] is optional (defaults to 0.001) anything smaller than this |
10 /// will be changed to this value, eliminating infinite results. | 10 /// will be changed to this value, eliminating infinite results. |
(...skipping 29 matching lines...) Expand all Loading... |
40 if (precision > 0) { | 40 if (precision > 0) { |
41 end++; | 41 end++; |
42 } | 42 } |
43 if (end > dStr.length) { | 43 if (end > dStr.length) { |
44 end = dStr.length; | 44 end = dStr.length; |
45 } | 45 } |
46 | 46 |
47 return dStr.substring(0, end); | 47 return dStr.substring(0, end); |
48 } | 48 } |
49 } | 49 } |
OLD | NEW |