Skip to content

Commit

Permalink
Used math.ceil instead of round to convert to the upper integer size
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemerle committed Sep 6, 2024
1 parent 5359521 commit c762ca3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/cloudnet/tosca/hot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
######################################################################

import logging # for logging purposes.
import math # for ceil function.

import cloudnet.tosca.configuration as configuration
import cloudnet.tosca.syntax as syntax
Expand Down Expand Up @@ -454,7 +455,7 @@ def generate_todo_translate(self, properties, property_name):

def convert_scaler_size(self, scalar_size, to_unit):
size, unit = split_scalar_unit(scalar_size)
result = round(
result = math.ceil(
size * type_system.SCALAR_SIZE_UNITS[unit]
/ type_system.SCALAR_SIZE_UNITS[to_unit]
)
Expand Down

0 comments on commit c762ca3

Please sign in to comment.