#*****************************************************************************80 # ## i1mach_test tests i1mach. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 06 February 2020 # # Author: # # John Burkardt # { cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "i1mach_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " i1mach(i) evaluates the i-th machine constant.\n" ) cat ( " associated with integer computer arithmetic.\n" ) source ( "/home/burkardt/public_html/r_src/machine/i1mach.R" ) cat ( "\n" ) cat ( " Numbers associated with input/output units:\n" ) cat ( "\n" ) cat ( " I1MACH(1) = the standard input unit = ", i1mach(1), "\n" ) cat ( " I1MACH(2) = the standard output unit = ", i1mach(2), "\n" ) cat ( " I1MACH(3) = the standard punch unit = ", i1mach(3), "\n" ) cat ( " I1MACH(4) = the standard error message unit = ", i1mach(4), "\n" ) cat ( "\n" ) cat ( " Numbers associated with words:\n" ) cat ( "\n" ) cat ( " I1MACH(5) = the number of bits per integer = ", i1mach(5), "\n" ) cat ( " I1MACH(6) = the number of characters per integer = ", i1mach(6), "\n" ) cat ( "\n" ) cat ( " Numbers associated with integer values:\n" ) cat ( "\n" ) cat ( " Assume integers are represented in the S digit \n" ) cat ( " base A form:\n" ) cat ( "\n" ) cat ( " Sign * (X(S-1)*A^(S-1) + ... + X(1)*A + X(0))\n" ) cat ( "\n" ) cat ( " where the digits X satisfy 0 <= X(1:S-1) < A.\n" ) cat ( "\n" ) cat ( " I1MACH(7) = A, the base = ", i1mach(7), "\n" ) cat ( " I1MACH(8) = S, the number of base A digits = ", i1mach(8), "\n" ) cat ( " I1MACH(9) = A^S-1, the largest integer = ", i1mach(9), "\n" ) cat ( "\n" ) cat ( " Numbers associated with floating point values:\n" ) cat ( "\n" ) cat ( " Assume floating point numbers are represented \n" ) cat ( " in the T digit base B form:\n" ) cat ( "\n" ) cat ( " Sign * (B^E) * ((X(1)/B) + ... + (X(T)/B^T) )\n" ) cat ( "\n" ) cat ( " where \n" ) cat ( "\n" ) cat ( " 0 <= X(1:T) < B,\n" ) cat ( " 0 < X(1) (unless the value being represented is 0),\n" ) cat ( " EMIN <= E <= EMAX.\n" ) cat ( "\n" ) cat ( " I1MACH(10) = B, the base = ", i1mach(10), "\n" ) cat ( "\n" ) cat ( " Numbers associated with single precision values:\n" ) cat ( "\n" ) cat ( " I1MACH(11) = T, the number of base B digits = ", i1mach(11), "\n" ) cat ( " I1MACH(12) = EMIN, the smallest exponent E = ", i1mach(12), "\n" ) cat ( " I1MACH(13) = EMAX, the largest exponent E = ", i1mach(13), "\n" ) cat ( "\n" ) cat ( " Numbers associated with double precision values:\n" ) cat ( "\n" ) cat ( " I1MACH(14) = T, the number of base B digits = ", i1mach(14), "\n" ) cat ( " I1MACH(15) = EMIN, the smallest exponent E = ", i1mach(15), "\n" ) cat ( " I1MACH(16) = EMAX, the largest exponent E. = ", i1mach(16), "\n" ) }