Class IntUtils


  • public class IntUtils
    extends Object
    Contains several utilities for integer typing.
    Author:
    Marc Miltenberger
    • Constructor Detail

      • IntUtils

        public IntUtils()
    • Method Detail

      • getTypeByWidth

        public static IntegerType getTypeByWidth​(int maxValue)
        Returns an appropriate integer for a given maximum element. Throws an exception in case of an unsupported size.
        Parameters:
        maxValue - the max value
        Returns:
        the integer
      • getMaxValue

        public static int getMaxValue​(IntegerType t)
        Returns the maximum value an integer type can have.
        Parameters:
        t - the integer type
        Returns:
        the maximum value