You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* plan(#79): initial brief from issue
* plan(#79): review brief
* plan(#79): create task breakdown
* feat(#79): implement tasks
* feat(#79): complete implementation
* fix(#79): Address PR review feedback
- Add guard for negative input values returning 0.0
- Add test for GetPercentileAtOrBelowValue(0) with positive recorded values
- Add test for negative input values
- Fix missing period in XML doc param tag
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Lee Campbell <lee.ryan.campbell@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: HdrHistogram/HistogramBase.cs
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -387,6 +387,42 @@ public long GetValueAtPercentile(double percentile)
387
387
thrownewArgumentOutOfRangeException(nameof(percentile),"percentile value not found in range");// should not reach here.
388
388
}
389
389
390
+
/// <summary>
391
+
/// Get the percentile at or below a given value.
392
+
/// This is the inverse of <see cref="GetValueAtPercentile"/>.
393
+
/// All values within the same equivalent-value range map to the same percentile.
394
+
/// </summary>
395
+
/// <param name="value">The value to find the percentile for.</param>
396
+
/// <returns>The percentage of recorded values that are less than or equal to <paramref name="value"/>, in the range <c>[0.0, 100.0]</c>. Returns <c>0.0</c> if no values have been recorded, or <c>100.0</c> if the value is at or above the highest trackable value.</returns>
0 commit comments