<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _enforceDataType(self, data):
 """ Converts to float so that this CTI always stores that type. Replaces infinite with the maximum respresentable float. Raises a ValueError if data is a NaN. """

        value = float(data)
        if math.isnan(value):
            raise ValueError("FloatCti can't store NaNs")

        if math.isinf(value):
            if value > 0:
                logger.warn("Replacing inf by the largest representable float")
                value = sys.float_info.max
            else:
                logger.warn("Replacing -inf by the smallest representable float")
                value = -sys.float_info.max

        return value