Download flutter/packages/flutter_driver/lib/src/driver/percentile_utils.dart from luom2645/agent-workspace: direct link, hf CLI and curl.
- Browser
- Download file 431 Bytes
-
https://huggingface.co/luom2645/agent-workspace/resolve/main/flutter/packages/flutter_driver/lib/src/driver/percentile_utils.dart
- Command line
-
hf download hf://luom2645/agent-workspace/flutter/packages/flutter_driver/lib/src/driver/percentile_utils.dart
-
curl -L -o percentile_utils.dart https://huggingface.co/luom2645/agent-workspace/resolve/main/flutter/packages/flutter_driver/lib/src/driver/percentile_utils.dart
431 Bytes
| // Copyright 2014 The Flutter Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| /// Returns the [p]-th percentile element from the [doubles]. | |
| /// `List<doubles>` will be sorted. | |
| double findPercentile(List<double> doubles, double p) { | |
| assert(doubles.isNotEmpty); | |
| doubles.sort(); | |
| return doubles[((doubles.length - 1) * (p / 100)).round()]; | |
| } | |