MCPcopy Index your code
hub / github.com/python/cpython / calculate_change

Method calculate_change

Tools/picklebench/memory_dos_impact.py:583–587  ·  view source on GitHub ↗

Calculate percentage change from baseline to current.

(baseline_value: float, current_value: float)

Source from the content-addressed store, hash-verified

581
582 @staticmethod
583 def calculate_change(baseline_value: float, current_value: float) -> float:
584 """Calculate percentage change from baseline to current."""
585 if baseline_value == 0:
586 return 0.0
587 return ((current_value - baseline_value) / baseline_value) * 100
588
589 @staticmethod
590 def format_comparison(

Callers 2

format_comparisonMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected