Module: CvssSuite::Cvss31Helper
- Defined in:
- lib/cvss_suite/helpers/cvss31_helper.rb
Overview
This module includes methods which are used by the CVSS 3 classes.
Class Method Summary collapse
-
.round_up(float) ⇒ Object
Since CVSS 3 all float values are rounded up, therefore this method is used instead of the mathematically correct method round().
Class Method Details
.round_up(float) ⇒ Object
Since CVSS 3 all float values are rounded up, therefore this method is used instead of the mathematically correct method round().
13 14 15 16 17 18 19 20 |
# File 'lib/cvss_suite/helpers/cvss31_helper.rb', line 13 def self.round_up(float) output = (float * 100_000).round if (output % 10_000).zero? output / 100_000.0 else ((output / 10_000).floor + 1) / 10.0 end end |