CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

Module Numbers

Provides predicates for working with numeric values and their string representations.

Import path

import codeql.util.Numbers

Predicates

parseBinaryInt

Gets the integer value of binary when interpreted as binary. binary must contain only the digits 0 and 1. For values greater than 01111111111111111111111111111111 (2^31-1, the maximum value that int can represent), there is no result.

parseHexInt

Gets the integer value of hex when interpreted as hex. hex must be a valid hexadecimal string. For values greater than 7FFFFFFF (2^31-1, the maximum value that int can represent), there is no result.

parseOctalInt

Gets the integer value of octal when interpreted as octal. octal must be a valid octal string containing only the digits 0-7. For values greater than 17777777777 (2^31-1, the maximum value that int can represent), there is no result.

to4digitHex

Gets a 4-digit hex representation of i.

toHex

Gets a hex representation of i.