Universal number system Command Line Tools
The universal library contains a collection of command line tools that help investigate
bit-level attributes of the number systems and the values they encode. These command line
tools get installed with the make install build target.
Most type-specific inspection tools (quarter, half, single, double, quad, fixpnt,
signedint, unsignedint, posit, float2posit) have been consolidated into
ucalc, the interactive mixed-precision calculator. ucalc provides
the same inspection capabilities via show, compare, precision, and range commands
across all 42+ number types. See the ucalc documentation for details.
The remaining standalone tools are described below.
Compare the three IEEE formats on a given real number value:
$ ieeeShow the truncated value and (sign/scale/fraction) components of different floating point types.Usage: ieee floating_point_valueExample: ieee 0.03124999input value: 0.03124999 float: 0.0312499907 (+,-6,11111111111111111111011) double: 0.031249989999999998 (+,-6,1111111111111111111101010100001100111000100011101110)long double: 0.0312499899999999983247 (+,-6,111111111111111111101001011110100011111111111110001111111001111)longdouble
Section titled “longdouble”Show the sign/scale/fraction components of an IEEE-754 long double.
On Windows using the Microsoft Visual Studio environment, the long double is aliased to double.
$ longdoublelongdouble: components of an IEEE long-double (compiler dependent, 80-bit extended precision on x86 and ARM, 128-bit on RISC-VShow the sign/scale/fraction components of an IEEE long double.Usage: longdouble long_double_valueExample: longdouble 0.03124999scientific : 0.0312499899999999983247triple form : (+,-6,111111111111111111110101010000110011100010001110111000000000000)binary form : 0b0.011'1111'1111'1001.1111'1111'1111'1111'1111'1010'1010'0001'1001'1100'0100'0111'0111'0000'0000'0000color coded : 0b0.0011'1111'1111'1001.111'1111'1111'1111'1111'1010'1010'0001'1001'1100'0100'0111'0111'0000'0000'0000Number Traits of IEEE-754 long doublestd::numeric_limits< e >min exponent -16381max exponent 16384radix 2radix digits 64min 3.3621e-4932max 1.18973e+4932lowest -1.18973e+4932epsilon (1+1ULP-1) 1.0842e-19round_error 0.5smallest value 3.6452e-4951infinity infquiet_NAN nansignaling_NAN nan
smallest normal number0b0.000000000000001.1000000000000000000000000000000000000000000000000000000000000000smallest denormalized number0b0.000000000000000.0000000000000000000000000000000000000000000000000000000000000001
Universal parameterization of IEEE-754 fieldsTotal number of bits : 80number of exponent bits : 15number of fraction bits : 63exponent bias : 16383Show the arithmetic properties of a posit environment, including its quire.
$ proppShow the arithmetic properties of a posit.Usage: propp [nbits es capacity]Example: propp 16 1 8arithmetic properties of a posit<16, 1> environment posit< 16, 1> useed scale 2 minpos scale - 28 maxpos scale 28 minpos : 16.1x0001p + 3.72529e-09 maxpos : 16.1x7fffp + 2.68435e+08Properties of a quire<16, 1, 8> dynamic range of product : 112 radix point of accumulator : 56 full quire size in bits : 120 lower quire size in bits : 56 upper quire size in bits : 57 capacity bits : 8Quire segments+ : 00000000_000000000000000000000000000000000000000000000000000000000.00000000000000000000000000000000000000000000000000000000plimits
Section titled “plimits”Show the numeric_limits<> of the standard posits.
$ plimitsplimits: numeric_limits<> of standard positsNumeric limits for posit< 8, 0>numeric_limits< sw::universal::posit<8, 0> >::min() : 0.015625numeric_limits< sw::universal::posit<8, 0> >::max() : 64numeric_limits< sw::universal::posit<8, 0> >::lowest() : -64numeric_limits< sw::universal::posit<8, 0> >::epsilon() : 0.03125numeric_limits< sw::universal::posit<8, 0> >::digits : 6numeric_limits< sw::universal::posit<8, 0> >::digits10 : 1numeric_limits< sw::universal::posit<8, 0> >::max_digits10 : 2numeric_limits< sw::universal::posit<8, 0> >::is_signed : 1numeric_limits< sw::universal::posit<8, 0> >::is_integer : 0numeric_limits< sw::universal::posit<8, 0> >::is_exact : 0numeric_limits< sw::universal::posit<8, 0> >::min_exponent : -6numeric_limits< sw::universal::posit<8, 0> >::min_exponent10 : -1numeric_limits< sw::universal::posit<8, 0> >::max_exponent : 6numeric_limits< sw::universal::posit<8, 0> >::max_exponent10 : 1numeric_limits< sw::universal::posit<8, 0> >::has_infinity : 1numeric_limits< sw::universal::posit<8, 0> >::has_quiet_NaN : 1numeric_limits< sw::universal::posit<8, 0> >::has_signaling_NaN : 1numeric_limits< sw::universal::posit<8, 0> >::has_denorm : 0numeric_limits< sw::universal::posit<8, 0> >::has_denorm_loss : 0numeric_limits< sw::universal::posit<8, 0> >::is_iec559 : 0numeric_limits< sw::universal::posit<8, 0> >::is_bounded : 0numeric_limits< sw::universal::posit<8, 0> >::is_modulo : 0numeric_limits< sw::universal::posit<8, 0> >::traps : 0numeric_limits< sw::universal::posit<8, 0> >::tinyness_before : 0numeric_limits< sw::universal::posit<8, 0> >::round_style : 1Numeric limits for posit< 16, 1>numeric_limits< sw::universal::posit<16, 1> >::min() : 3.72529e-09numeric_limits< sw::universal::posit<16, 1> >::max() : 2.68435e+08numeric_limits< sw::universal::posit<16, 1> >::lowest() : -2.68435e+08numeric_limits< sw::universal::posit<16, 1> >::epsilon() : 0.000244141numeric_limits< sw::universal::posit<16, 1> >::digits : 13numeric_limits< sw::universal::posit<16, 1> >::digits10 : 3numeric_limits< sw::universal::posit<16, 1> >::max_digits10 : 4...Show size tables of quires.
$ propqprint quire size tablesQuire size table as a function of <nbits, es, capacity = 10>Capacity is 2^10 accumulations of max_pos^2 nbits es value + 0 1 2 3 4 5 6 7 8 9 4 18 26 42 74 138 266 522 1034 2058 4106 5 22 34 58 106 202 394 778 1546 3082 6154 6 26 42 74 138 266 522 1034 2058 4106 8202 7 30 50 90 170 330 650 1290 2570 5130 10250 8 34 58 106 202 394 778 1546 3082 6154 12298 9 38 66 122 234 458 906 1802 3594 7178 14346 10 42 74 138 266 522 1034 2058 4106 8202 16394 11 46 82 154 298 586 1162 2314 4618 9226 18442 12 50 90 170 330 650 1290 2570 5130 10250 20490