### /u/sy/beebe/mpieee-test.maple, Wed Nov 28 17:31:49 2001 ### Edit by Nelson H. F. Beebe ### ==================================================================== ### Test the mpieee.maple program (assumed to be loaded already) with ### special values near the IEEE 754 limits: ### ==================================================================== fplimits := proc() local p: printf("------------------------------------------------------------------------\n"); printf("Machine epsilon (2^(-p + 1))\n"): for p in 24, 53, 64, 113 do printf("Precision = %d bits\n", p); F(2^(-p + 1)): end do: printf("------------------------------------------------------------------------\n"); printf("Largest finite (1 - 2^(-p))*2^(maximum exponent + 1)\n"): printf("Precision = %d bits\n", 24); printf("Maximum exponent = %d\n", 127); F((1 - 2^( -24)) * 2^128): printf("Precision = %d bits\n", 53); printf("Maximum exponent = %d\n", 1023); F((1 - 2^( -53)) * 2^1024): printf("Precision = %d bits\n", 64); printf("Maximum exponent = %d\n", 16383); F((1 - 2^( -64)) * 2^16384): printf("Precision = %d bits\n", 113); printf("Maximum exponent = %d\n", 16383); F((1 - 2^(-113)) * 2^16384): printf("------------------------------------------------------------------------\n"); printf("Smallest normalized finite (2^(minimum exponent))\n"): for p in -126, -1022, -16382, -16382 do printf("Minimum exponent = %d\n", p); F(2^(p)): end do: printf("------------------------------------------------------------------------\n"); printf("Smallest denormalized finite (2^(minimum exponent - stored fraction bits))\n"): for p in -149, -1074, -16446, -16494 do printf("Minimum exponent - stored fraction bits = %d\n", p); F(2^(p)): end do: end proc: fplimits();