File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 3
3
from .enums import *
4
4
from decimal import Decimal as D
5
5
from cvsslib .base_enum import NotDefined
6
+ import decimal
6
7
7
8
8
9
EXPLOITABILITY_COEFFECIENT = D ("8.22" )
@@ -59,9 +60,9 @@ def calculate_modified_impact_sub_score(scope: ModifiedScope,
59
60
)
60
61
61
62
if scope == ModifiedScope .UNCHANGED .value :
62
- return IMPACT_UNCHANGED_COEFFECIENT * modified
63
+ return IMPACT_UNCHANGED_COEFFECIENT * decimal . Decimal ( modified )
63
64
else :
64
- return IMPACT_CHANGED_COEFFECIENT * (modified - D ("0.029" )) - D ("3.25" ) * D (math .pow (modified - D (0.02 ), 15 ))
65
+ return IMPACT_CHANGED_COEFFECIENT * (decimal . Decimal ( modified ) - D ("0.029" )) - D ("3.25" ) * D (math .pow (decimal . Decimal ( modified ) - D (0.02 ), 15 ))
65
66
66
67
67
68
def calculate_base_score (run_calculation , scope : Scope , privilege : PrivilegeRequired ):
@@ -144,4 +145,4 @@ def calculate(run_calculation, get):
144
145
145
146
environment_score = run_calculation (calculate_environmental_score , override = override )
146
147
147
- return float (base_score ), float (temporal_score ), float (environment_score )
148
+ return float (base_score ), float (temporal_score ), float (environment_score )
You can’t perform that action at this time.
0 commit comments