lc is open software; you can redistribute it and/or modify it under ## the terms of the version 2.1 of the GNU Lesser General Public License ## as published by the Free Software Foundation. ## ## Calc is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General ## Public License for more details. ## ## A copy of version 2.1 of the GNU Lesser General Public License is ## distributed with calc under the filename COPYING-LGPL. You should have ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: pmodm127,v 30.1 2007/03/16 11:10:04 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pmodm127,v $ ## ## Under source code control: 2004/02/25 07:13:15 ## File existed as early as: 2004 ## ## chongo /\oo/\ http://www.isthe.com/chongo/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ /* * test8600 - 8600 series of the regress.cal test suite * * Copyright (C) 2000 Landon Curt Noll * * Primary author: Landon Curt Noll * * Calc is open software; you can redistribute it and/or modify it under * the terms of the version 2.1 of the GNU Lesser General Public License * as published by the Free Software Foundation. * * Calc is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * Public License for more details. * * A copy of version 2.1 of the GNU Lesser General Public License is * distributed with calc under the filename COPYING-LGPL. You should have * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @(#) $Revision: 30.1 $ * @(#) $Id: test8600.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8600.cal,v $ * * Under source code control: 2000/12/04 19:57:02 * File existed as early as: 2000 * * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ */ /* * test8600 - test builtin functions with 1024 args */ /* * min with 1024 args, one per line */ min_8600 = min( 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 503, 5039, 5051, 5059, 5077, 5081, 5087, 509, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 521, 5227, 523, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 541, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 547, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 557, 5573, 5581, 5591, 5623, 563, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 569, 5693, 5701, 571, 5711, 5717, 5737, 5741, 5743, 5749, 577, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 587, 5879, 5881, 5897, 5903, 5923, 5927, 593, 5939, 5953, 5981, 5987, 599, 6007, 601, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 607, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 613, 6131, 6133, 6143, 6151, 6163, 617, 6173, 619, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 631, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 641, 6421, 6427, 643, 6449, 6451, 6469, 647, 6473, 6481, 6491, 6521, 6529, 653, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 659, 6599, 6607, 661, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 673, 6733, 6737, 6761, 6763, 677, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 683, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 691, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 701, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 709, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 719, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 727, 7283, 7297, 7307, 7309, 7321, 733, 7331, 7333, 7349, 7351, 7369, 739, 7393, 7411, 7417, 743, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 751, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 757, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 761, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 769, 7691, 7699, 7703, 7717, 7723, 7727, 773, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 787, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 797, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 809, 8093, 8101, 811, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 821, 8219, 8221, 823, 8231, 8233, 8237, 8243, 8263, 8269, 827, 8273, 8287, 829, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 839, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 853, 8537, 8539, 8543, 8563, 857, 8573, 8581, 859, 8597, 8599, 8609, 8623, 8627, 8629, 863, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 877, 8779, 8783, 8803, 8807, 881, 8819, 8821, 883, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 887, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 907, 9091, 9103, 9109, 911, 9127); vrfy(min_8600 == 503, "8601: min() called with 1024 args"); /* * max with 1024 args */ max_8600 = max(1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 503, 5039, 5051, 5059, 5077, 5081, 5087, 509, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 521, 5227, 523, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 541, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 547, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 557, 5573, 5581, 5591, 5623, 563, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 569, 5693, 5701, 571, 5711, 5717, 5737, 5741, 5743, 5749, 577, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 587, 5879, 5881, 5897, 5903, 5923, 5927, 593, 5939, 5953, 5981, 5987, 599, 6007, 601, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 607, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 613, 6131, 6133, 6143, 6151, 6163, 617, 6173, 619, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 631, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 641, 6421, 6427, 643, 6449, 6451, 6469, 647, 6473, 6481, 6491, 6521, 6529, 653, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 659, 6599, 6607, 661, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 673, 6733, 6737, 6761, 6763, 677, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 683, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 691, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 701, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 709, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 719, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 727, 7283, 7297, 7307, 7309, 7321, 733, 7331, 7333, 7349, 7351, 7369, 739, 7393, 7411, 7417, 743, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 751, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 757, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 761, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 769, 7691, 7699, 7703, 7717, 7723, 7727, 773, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 787, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 797, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 809, 8093, 8101, 811, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 821, 8219, 8221, 823, 8231, 8233, 8237, 8243, 8263, 8269, 827, 8273, 8287, 829, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 839, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 853, 8537, 8539, 8543, 8563, 857, 8573, 8581, 859, 8597, 8599, 8609, 8623, 8627, 8629, 863, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 877, 8779, 8783, 8803, 8807, 881, 8819, 8821, 883, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 887, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 907, 9091, 9103, 9109, 911, 9127); vrfy(max_8600 == 9127, "8602: max() called with 1024 args"); /* * ssq with 1024 args */ ssq_8600 = ssq(1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 503, 5039, 5051, 5059, 5077, 5081, 5087, 509, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 521, 5227, 523, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 541, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 547, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 557, 5573, 5581, 5591, 5623, 563, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 569, 5693, 5701, 571, 5711, 5717, 5737, 5741, 5743, 5749, 577, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 587, 5879, 5881, 5897, 5903, 5923, 5927, 593, 5939, 5953, 5981, 5987, 599, 6007, 601, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 607, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 613, 6131, 6133, 6143, 6151, 6163, 617, 6173, 619, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 631, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 641, 6421, 6427, 643, 6449, 6451, 6469, 647, 6473, 6481, 6491, 6521, 6529, 653, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 659, 6599, 6607, 661, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 673, 6733, 6737, 6761, 6763, 677, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 683, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 691, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 701, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 709, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 719, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 727, 7283, 7297, 7307, 7309, 7321, 733, 7331, 7333, 7349, 7351, 7369, 739, 7393, 7411, 7417, 743, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 751, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 757, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 761, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 769, 7691, 7699, 7703, 7717, 7723, 7727, 773, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 787, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 797, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 809, 8093, 8101, 811, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 821, 8219, 8221, 823, 8231, 8233, 8237, 8243, 8263, 8269, 827, 8273, 8287, 829, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 839, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 853, 8537, 8539, 8543, 8563, 857, 8573, 8581, 859, 8597, 8599, 8609, 8623, 8627, 8629, 863, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 877, 8779, 8783, 8803, 8807, 881, 8819, 8821, 883, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 887, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 907, 9091, 9103, 9109, 911, 9127); vrfy(ssq_8600 == 28585330720, "8603: ssq() called with 1024 args"); /* * hash with 1024 args */ hash_8600 = hash(1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 503, 5039, 5051, 5059, 5077, 5081, 5087, 509, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 521, 5227, 523, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 541, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 547, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 557, 5573, 5581, 5591, 5623, 563, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 569, 5693, 5701, 571, 5711, 5717, 5737, 5741, 5743, 5749, 577, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 587, 5879, 5881, 5897, 5903, 5923, 5927, 593, 5939, 5953, 5981, 5987, 599, 6007, 601, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 607, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 613, 6131, 6133, 6143, 6151, 6163, 617, 6173, 619, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 631, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 641, 6421, 6427, 643, 6449, 6451, 6469, 647, 6473, 6481, 6491, 6521, 6529, 653, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 659, 6599, 6607, 661, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 673, 6733, 6737, 6761, 6763, 677, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 683, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 691, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 701, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 709, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 719, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 727, 7283, 7297, 7307, 7309, 7321, 733, 7331, 7333, 7349, 7351, 7369, 739, 7393, 7411, 7417, 743, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 751, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 757, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 761, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 769, 7691, 7699, 7703, 7717, 7723, 7727, 773, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 787, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 797, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 809, 8093, 8101, 811, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 821, 8219, 8221, 823, 8231, 8233, 8237, 8243, 8263, 8269, 827, 8273, 8287, 829, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 839, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 853, 8537, 8539, 8543, 8563, 857, 8573, 8581, 859, 8597, 8599, 8609, 8623, 8627, 8629, 863, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 877, 8779, 8783, 8803, 8807, 881, 8819, 8821, 883, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 887, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 907, 9091, 9103, 9109, 911, 9127); vrfy(hash_8600 == 1365716825, "8604: hash() called with 1024 args"); /* * int(hmean with 1024 args) */ hmean_8600 = int( hmean(1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 503, 5039, 5051, 5059, 5077, 5081, 5087, 509, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 521, 5227, 523, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 541, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 547, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 557, 5573, 5581, 5591, 5623, 563, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 569, 5693, 5701, 571, 5711, 5717, 5737, 5741, 5743, 5749, 577, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 587, 5879, 5881, 5897, 5903, 5923, 5927, 593, 5939, 5953, 5981, 5987, 599, 6007, 601, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 607, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 613, 6131, 6133, 6143, 6151, 6163, 617, 6173, 619, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 631, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 641, 6421, 6427, 643, 6449, 6451, 6469, 647, 6473, 6481, 6491, 6521, 6529, 653, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 659, 6599, 6607, 661, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 673, 6733, 6737, 6761, 6763, 677, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 683, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 691, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 701, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 709, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 719, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 727, 7283, 7297, 7307, 7309, 7321, 733, 7331, 7333, 7349, 7351, 7369, 739, 7393, 7411, 7417, 743, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 751, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 757, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 761, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 769, 7691, 7699, 7703, 7717, 7723, 7727, 773, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 787, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 797, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 809, 8093, 8101, 811, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 821, 8219, 8221, 823, 8231, 8233, 8237, 8243, 8263, 8269, 827, 8273, 8287, 829, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 839, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 853, 8537, 8539, 8543, 8563, 857, 8573, 8581, 859, 8597, 8599, 8609, 8623, 8627, 8629, 863, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 877, 8779, 8783, 8803, 8807, 881, 8819, 8821, 883, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 887, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 907, 9091, 9103, 9109, 911, 9127)); vrfy(hmean_8600 == 2816, "8605: int(hmean()) called with 1024 args"); /* * finished with 8600 tests */ print '8606: Ending test_1024args'; /* * hms - calculate in hours, minutes, and seconds * * Copyright (C) 2010 Landon Curt Noll * * Calc is open software; you can redistribute it and/or modify it under * the terms of the version 2.1 of the GNU Lesser General Public License * as published by the Free Software Foundation. * * Calc is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * Public License for more details. * * A copy of version 2.1 of the GNU Lesser General Public License is * distributed with calc under the filename COPYING-LGPL. You should have * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @(#) $Revision: 30.2 $ * @(#) $Id: hms.cal,v 30.2 2010/09/02 06:14:16 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/hms.cal,v $ * * Under source code control: 2010/09/01 17:14:55 * File existed as early as: 2010 * * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ */ obj hms {hour, min, sec}; define hms(hour, min, sec) { local obj hms ans; /* return value */ /* default missing args to 0 */ if (isnull(sec)) { sec = 0; } if (isnull(min)) { min = 0; } /* load object */ ans.hour = hour; ans.min = min; ans.sec = sec; /* return properly formed object */ ans = fixhms(ans); return ans; } define hms_add(a, b) { local obj hms ans; /* return value */ /* initalize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is hms object, load it */ ans.hour = a.hour; ans.min = a.min; ans.sec = a.sec; } else { /* 1st arg is not hms, assume scalar hours */ ans.hour = a; ans.min = 0; ans.sec = 0; } /* add value of 2nd arg */ if (istype(b, ans)) { /* 2nd arg is hms object, add it */ ans.hour += b.hour; ans.min += b.min; ans.sec += b.sec; } else { /* 2nd arg is not hms, add scalar hours */ ans.hour += b; } /* return normalized result */ ans = fixhms(ans); return ans; } define hms_neg(a) { local obj hms ans; /* return value */ /* negate argument */ if (istype(a, ans)) { /* 1st arg is hms object, load it */ ans.hour = -a.hour; ans.min = -a.min; ans.sec = -a.sec; } else { /* 2nd arg is not hms, negate scalar hours */ ans.hour = -a; ans.min = 0; ans.sec = 0; } /* return normalized result */ ans = fixhms(ans); return ans; } define hms_sub(a, b) { local obj hms ans; /* return value */ /* initalize value to 1st arg */ if (istype(a, ans)) { /* 1st arg is hms object, load it */ ans.hour = a.hour; ans.min = a.min; ans.sec = a.sec; } else { /* 1st arg is not hms, assume scalar hours */ ans.hour = a; ans.min = 0; ans.sec = 0; } /* subtract value of 2nd arg */ if (istype(b, ans)) { /* 2nd arg is hms object, subtract it */ ans.hour -= b.hour; ans.min -= b.min; ans.sec -= b.sec; } else { /* 2nd arg is not hms, subtract scalar hours */ ans.hour -= b; } /* return normalized result */ ans = fixhms(ans); return ans; } define hms_mul(a, b) { local obj hms ans; /* return value */ /* hms object multiplication */ if (istype(a, ans) && istype(b, ans)) { ans.hour = hms_abs(a) * hms_abs(b); ans.min = 0; ans.sec = 0; /* scalar multiplication */ } else if (istype(a, ans)) { ans.hour = a.hour * b; ans.min = a.min * b; ans.sec = a.sec * b; } else { ans.hour = b.hour * a; ans.min = b.min * a; ans.sec = b.sec * a; } /* return normalized result */ ans = fixhms(ans); return ans; } define hms_print(a) { local obj hms ans; /* temp object for hms type testing */ /* firewall - arg must be a hms object */ if (! istype(a, ans)) { quit "hms_print called with non hms object"; } /* print in hms form */ print a.hour : ':' : a.min : ':' : a.sec :; } define hms_abs(a) { local obj hms ans; /* temp object for hms type testing */ local hour; /* return scalar value */ /* firewall - just absolute value non hms objects */ if (! istype(a, ans)) { return abs(a); } /* compute hours */ hour = a.hour + a.min / 60 + a.sec / 3600; /* return hours */ return hour; } define hms_norm(a) { local obj hms ans; /* temp object for hms type testing */ local hour; /* hours */ /* firewall - arg must be a hms object */ if (! istype(a, ans)) { quit "hms_norm called with non hms object"; } /* square hours (norm is the square of absolute value */ hour = hms_abs(a); /* return hours */ return hour*hour; } define hms_test(a) { local obj hms ans; /* temp value */ /* firewall - arg must be a hms object */ if (! istype(a, ans)) { quit "hms_test called with non hms object"; } /* return false of non-zero */ ans = fixhms(a); if (ans.hour == 0 && ans.min == 0 && ans.sec == 0) { /* false */ return 0; } /* true */ return 1; } define hms_int(a) { local obj hms ans; /* return value */ /* firewall - arg must be a hms object */ if (! istype(a, ans)) { quit "hms_int called with non hms object"; } /* normalize the argument */ ans = fixhms(a); /* truncate to the nearest second */ ans.sec = int(ans.sec); /* return value to the nearest second */ return ans; } define hms_frac(a) { local obj hms ans; /* return value */ /* firewall - arg must be a hms object */ if (! istype(a, ans)) { quit "hms_frac called with non hms object"; } /* normalize the argument */ ans = fixhms(a); /* remove all but fractional seconds */ ans.hour = 0; ans.min = 0; ans.sec = frac(ans.sec); /* return value to the second fraction */ return ans; } define hms_rel(a,b) { local abs_a, abs_b; /* scalars of the arguments */ /* compute scalars of the arguments */ abs_a = hms_abs(a); abs_b = hms_abs(b); /* return the comparison */ return cmp(abs_a, abs_b); } define hms_cmp(a,b) { local abs_a, abs_b; /* scalars of the arguments */ /* compute scalars of the arguments */ abs_a = hms_abs(a); abs_b = hms_abs(b); /* return the equality comparison */ return (abs_a == abs_b); } define hms_inc(a) { local obj hms ans; /* return value */ /* increment a hms object */ if (istype(a, ans)) { ans = a; ++ans.sec; /* return normalized result */ ans = fixhms(ans); return ans; } /* increment a scalar */ return a+1; } define hms_dec(a) { local obj hms ans; /* return value */ /* decrement a hms object */ if (istype(a, ans)) { ans = a; --ans.sec; /* return normalized result */ ans = fixhms(ans); return ans; } /* decrement a scalar */ return a-1; } define fixhms(a) { local obj hms ans; /* temp value */ /* firewall */ if (! istype(a, ans)) { quit "attempt to fix a non hms object"; } /* force minutes to be intergral */ a.min += frac(a.hour) * 60; a.hour = int(a.hour); /* force hours to be intergral */ a.sec += frac(a.min) * 60; a.min = int(a.min); /* carry excess seconds into minutes */ a.min += a.sec // 60; a.sec %= 60; /* carry excess minutes into hours */ a.hour += a.min // 60; a.min %= 60; /* round hours by day */ a.hour %= 24; /* return normalized result */ return a; } if (config("resource_debug") & 3) { print "obj hms {hour, min, sec} defined"; } /* * regress - calc regression and correctness test suite * * Copyright (C) 1999-2006 David I. Bell and Landon Curt Noll * * Calc is open software; you can redistribute it and/or modify it under * the terms of the version 2.1 of the GNU Lesser General Public License * as published by the Free Software Foundation. * * Calc is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * Public License for more details. * * A copy of version 2.1 of the GNU Lesser General Public License is * distributed with calc under the filename COPYING-LGPL. You should have * received a copy with calc; if not, write to Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @(#) $Revision: 30.6 $ * @(#) $Id: regress.cal,v 30.6 2010/09/02 06:09:06 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $ * * Under source code control: 1990/02/15 01:50:36 * File existed as early as: before 1990 * * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ */ /* * Test the correct execution of the calculator by reading this resource file. * Errors are reported with '****' messages, or worse. :-) * * NOTE: Unlike most calc resource files, this one performs its work when * it is read. Normally one would just define functions and * values for later use. In the case of the regression test, * we do not want to do this. */ print '000: Beginning regression tests'; print '001: Some of these tests may take a while ...'; print '002: Within each section, output should be numbered sequentially'; global prob; /* libregress.cal problem counter */ prob = 0; /* clear problem counter */ errcount(0),; /* clear error count */ errmax(-1),; /* prevent errcount from abouting */ global ecnt; /* expected value of errcount() */ ecnt = 0; /* clear expected errcount() value */ initcfg = config("all", "newstd"); /* set config to startup default */ defcfg = config("all"); /* capture the default config */ config("resource_debug", 0),; /* disable resource startup messages */ config("calc_debug", 0),; /* disable internal debugging */ config("verbose_quit", 0),; /* disable quit messages */ startcfg = config("all"); /* save state for later use */ print '003: parsed global definitions'; /* * vrfy - vrfy that a test is true * * Counts and reports errors or prints test string if successful. * * This function also detects when errcount() exceeds ecnt * and reports when this happens. A side effect is that a * new ecnt level is established. If errcount exceeds errcount * but otherwise the test is successful, the string is still printed. */ define vrfy(test, str) { if (errcount() > ecnt) { print '**** errcount:' : errcount(), ' > ecnt:' : ecnt; ecnt = errcount(); ++prob; } if (test != 1) { print '**** Non-true result (' : test : '): ' : str; ++prob; } else { print str; } return; } print '004: parsed vrfy()'; /* * prob - alternate error notification and count */ define prob(str) { print '****' , str; ++prob; } print '005: parsed prob(str)'; /* * getglobalvar - used to return a global value */ define getglobalvar() { global globalvar; return globalvar; } print '006: parsed getglobalvar()'; /* * Test boolean operations and IF tests. * * Some of these tests are done twice, once to print the message and * once to count any errors. This means that some successful tests * will display a passing message twice. Oh well, no biggie. */ define test_booleans() { local x; local y; local t1, t2, t3; print '300: Beginning test_booleans'; if (0) print '**** if (0)'; if (0) prob = prob + 1; if (1) print '301: if (1)'; if (2) print '302: if (2)'; if (1) print '303: if (1) else'; else print '**** if (1) else'; if (1) print '304: if (1) else'; else prob = prob + 1; if (0) print '**** if (0) else'; else print '305: if (0) else'; if (0) prob = prob + 1; else print '306: if (0) else'; if (1 == 1) print '307: if 1 == 1'; else print '**** if 1 == 1'; if (1 == 1) print '308: if 1 == 1'; else prob = prob + 1; if (1 != 2) print '309: if 1 != 2'; else print '**** if 1 != 2'; if (1 != 2) print '310: if 1 != 2'; else prob = prob + 1; vrfy(1, '311: vrfy 1'); vrfy(2 == 2, '312: vrfy 2 == 2'); vrfy(2 != 3, '313: vrfy 2 != 3'); vrfy(2 < 3, '314: vrfy 2 < 3'); vrfy(2 <= 2, '315: vrfy 2 <= 2'); vrfy(2 <= 3, '316: vrfy 2 <= 3'); vrfy(3 > 2, '317: vrfy 3 > 2'); vrfy(2 >= 2, '318: vrfy 2 >= 2'); vrfy(3 >= 2, '319: vrfy 3 >= 2'); vrfy(!0, '320: vrfy !0'); vrfy(!1 == 0,'321: vrfy !1 == 0'); vrfy((1 ? 2 ? 3 : 4 : 5) == 3, '322: (1 ? 2 ? 3 : 4 : 5) == 3'); print '323: Ending test_booleans'; } print '007: parsed test_booleans()'; /* * Test variables, simple assignments, AND and OR operators, short-circuit eval */ define test_variables() { local x1, x2, x3; global g1, g2; local t; local x; print '350: Beginning test_variables'; x1 = 5; x3 = 7 * 2; x2 = 9 + 1; globalvar = 22; g1 = 19 - 3; g2 = 79; vrfy(x1 == 5, '351: x1 == 5'); vrfy(x2 == 10, '352: x2 == 10'); vrfy(x3 == 14, '353: x3 == 14'); vrfy(g1 == 16, '354: g1 == 16'); vrfy(g2 == 79, '355: g2 == 79'); vrfy(globalvar == 22, '356: globalvar == 22'); vrfy(getglobalvar() == 22, '357: getglobalvar() == 22'); x1 = x2 + x3 + g1; vrfy(x1 == 40, '358: x1 == 40'); g1 = x3 + g2; vrfy(g1 == 93, '359: g1 == 207'); x1 = 5; vrfy(x1++ == 5, '360: x1++ == 5'); vrfy(x1 == 6, '361: x1 == 6'); vrfy(++x1 == 7, '362: ++x1 == 7'); x1 += 3; vrfy(x1 == 10, '363: x1 == 10'); x1 -= 6; vrfy(x1 == 4, '364: x1 == 4'); x1 *= 3; vrfy(x1 == 12, '365: x1 == 12'); x1 /= 4; vrfy(x1 == 3, '366: x1 == 3'); x1 = x2 = x3; vrfy(x2 == 14, '367: x2 == 14'); vrfy(x1 == 14, '368: x1 == 14'); if (2 && 3) { print '369: if (2 && 3)'; } else { print '**** if (2 && 3)'; ++prob; } if (2 && 0) { print '**** if (2 && 0)'; ++prob; } else { print '370: if (2 && 0)'; } if (0 && 2) { print '**** if (0 && 2)'; ++prob; } else { print '371: if (0 && 2)'; } if (0 && 0) { print '**** if (0 && 0)'; ++prob; } else { print '372: if (0 && 0)'; } if (2 || 0) { print '373: if (2 || 0)'; } else { print '**** if (2 || 0)'; ++prob; } if (0 || 2) { print '374: if (0 || 2)'; } else { print '**** if (0 || 2)'; ++prob; } if (0 || 0) { print '**** if (0 || 0)'; ++prob; } else { print '375: if (0 || 0)'; } x = 2 || 3; vrfy(x == 2, '376: (2 || 3) == 2'); x = 2 || 0; vrfy(x == 2, '377: (2 || 0) == 2'); x = 0 || 3; vrfy(x == 3, '378: (0 || 3) == 3'); x = 0 || 0; vrfy(x == 0, '379: (0 || 0) == 0'); x = 2 && 3; vrfy(x == 3, '380: (2 && 3) == 3'); x = 2 && 0; vrfy(x == 0, '381: (2 && 0) == 0'); x = 0 && 3; vrfy(x == 0, '382: (0 && 3) == 0'); x = 2 || prob('2 || prob()'); print "383: x = 2 || prob('2 || prob()'"; x = 0 && prob('0 && prob()'); print "384: x = 0 && prob('0 && prob()'"; print '385: Ending test_variables'; } print '008: parsed test_variables()'; /* * Test simple arithmetic operations and expressions. */ define test_arithmetic() { print '400: Beginning test_arithmetic'; vrfy(3+4==7, '401: 3 + 4 == 7'); vrfy(4-1==3, '402: 4 - 1 == 3'); vrfy(2*3==6, '403: 2 * 3 == 6'); vrfy(8/4==2, '404: 8 / 4 == 2'); vrfy(2^3==8, '405: 2 ^ 3 == 8'); vrfy(9-4-2==3, '406: 9-4-2 == 3'); vrfy(9-4+2==7, '407: 9-4+2 == 7'); vrfy(-5+2==-3, '408: -5+2 == -3'); vrfy(2*3+1==7, '409: 2*3+1 == 7'); vrfy(1+2*3==7, '410: 1+2*3 == 7'); vrfy((1+2)*3==9, '411: (1+2)*3 == 9'); vrfy(2*(3+1)==8, '412: 2*(3+1) == 8'); vrfy(9-(2+3)==4, '413: 9-(2+3) == 4'); vrfy(9+(2-3)==8, '414: 9+(2-3) == 8'); vrfy((2+3)*(4+5)==45, '415: (2+3)*(4+5) == 45'); vrfy(10/(2+3)==2, '416: 10/(2+3) == 2'); vrfy(12/3+4==8, '417: 12/3+4 == 8'); vrfy(6+12/3==10, '418: 6+12/3 == 10'); vrfy(2+3==1+4, '419: 2+3 == 1+4'); vrfy(-(2+3)==-5, '420: -(2+3) == -5'); vrfy(7&18==2, '421: 7&18 == 2'); vrfy(3|17==19, '422: 3|17 == 19'); vrfy(2&3|1==3, '423: 2&3|1 == 3'); vrfy(2&(3|1)==2, '424: 2&(3|1) == 2'); vrfy(3<<4==48, '425: 3<<4 == 48'); vrfy(5>>1==2, '426: 5>>1 == 2'); vrfy(3<<-1==1, '427: 3<<-1 == 1'); vrfy(5>>-2==20, '428: 5>>-2 == 20'); vrfy(1<<2<<3==65536, '429: 1<<2<<3 == 65536'); vrfy((1<<2)<<3==32, '430: (1<<2)<<3 == 32'); vrfy(2^3^2==512, '431: 2^3^2 == 512'); vrfy((2^3)^2==64, '432: (2^3)^2 == 64'); vrfy(4//3==1, '433: 4//3==1'); vrfy(4//-3==-1, '434: 4//-3==-1'); vrfy(0.75//-0.51==-1, '435: 0.75//-0.51==-1'); vrfy(0.75//-0.50==-1, '436: 0.75//-0.50==-1'); vrfy(0.75//-0.49==-1, '437: 0.75//-0.49==-1'); vrfy((3/4)//(-1/4)==-3, '438: (3/4)//(-1/4)==-3'); vrfy(7%3==1, '439: 7%3==1'); vrfy(0-.5==-.5, '440: 0-.5==-.5'); vrfy(0^0 == 1, '441: 0^0 == 1'); vrfy(0^1 == 0, '442: 0^1 == 0'); vrfy(1^0 == 1, '443: 1^0 == 1'); vrfy(1^1 == 1, '444: 1^1 == 1'); vrfy(1/(.8+.8i)==.625-.625i, '445: 1/(.8+.8i)==.625-.625i'); vrfy((.6+.8i)*(3.6-4.8i)==6, '446: (.6+.8i)*(3.6-4.8i)==6'); vrfy(-16^-2 == -1/256, '447: -16^-2 == -1/256'); vrfy(-7^2 == -49, '448: -7^2 == -49'); vrfy(-3! == -6, '449: -3! == -6'); print '450: Ending test_arithmetic'; } print '009: parsed test_arithmetic()'; /* * test_config - test config control */ define test_config() { local callcfg; /* caller configuration value */ local oldcfg; /* caller configuration value */ local newcfg; /* caller configuration value */ print '500: Beginning test_config'; /* check the set and return of all config */ callcfg = config("all"); print '501: callcfg = config("all")'; vrfy(callcfg == startcfg, '502: callcfg == startcfg'); callcfg = config("all", "oldstd"); print '503: callcfg = config("all","oldstd")'; vrfy(callcfg == startcfg, '504: callcfg == startcfg'); oldcfg = config("all"); print '505: oldcfg = config("all");'; vrfy(config("all") == oldcfg, '506: config("all") == oldcfg'); vrfy(oldcfg==config("all","newstd"), '507: oldcfg==config("all","newstd")'); vrfy(defcfg == config("all"), '508: defcfg == config("all")'); /* vrfy the state of the default config */ vrfy(config("mode") == "real", '509: config("mode") == "real"'); vrfy(config("display") == 20, '510: config("display") == 20'); vrfy(config("epsilon") == 1e-20, '511: config("epsilon") == 1e-20'); vrfy(config("trace") == 0, '512: config("trace") == 0'); vrfy(config("maxprint") == 16, '513: config("maxprint") == 16'); vrfy(config("mul2") == 1780, '514: config("mul2") == 1780'); vrfy(config("sq2") == 3388, '515: config("sq2") == 3388'); vrfy(config("pow2") == 176, '516: config("pow2") == 176'); vrfy(config("redc2") == 220, '517: config("redc2") == 220'); vrfy(config("tilde"), '518: config("tilde")'); vrfy(config("tab"), '519: config("tab")'); vrfy(config("quomod") == 0, '520: config("quomod") == 0'); vrfy(config("quo") == 2, '521: config("quo") == 2'); vrfy(config("mod") == 0, '522: config("mod") == 0'); vrfy(config("sqrt") == 24, '523: config("sqrt") == 24'); vrfy(config("appr") == 24, '524: config("appr") == 24'); vrfy(config("cfappr") == 0, '525: config("cfappr") == 0'); vrfy(config("cfsim") == 8, '526: config("cfsim") == 8'); vrfy(config("outround") == 24, '527: config("outround") == 24'); vrfy(config("round") == 24, '528: config("round") == 24'); vrfy(config("leadzero") == 1, '529: config("leadzero") == 1'); vrfy(config("fullzero") == 0, '530: config("fullzero") == 0'); vrfy(config("maxscan") == 20, '531: config("maxscan") == 20'); vrfy(config("prompt") == "; ", '532: config("prompt") == "; "'); vrfy(config("more") == ";; ", '533: config("more") == ";; "'); /* convert to "oldstd" config by individual changes */ print '534: test unused'; vrfy(config("outround", 2) == 24, '535: config("outround", 2) == 24'); vrfy(config("leadzero","n") == 1, '536: config("leadzero","n") == 1'); print '537: test unused'; vrfy(config("prompt", "> ") == "; ", '538: confi  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~g("prompt", "> ") == "; "'); vrfy(config("more", ">> ") == ";; ", '539: config("more", ">> ") == ";; "'); vrfy(config("all") == oldcfg, '540: config("all") == oldcfg'); /* restore the configation at the start of this function */ vrfy(config("all",callcfg) == oldcfg, '541: config("all",callcfg) == oldcfg'); /* display and fullzero tests */ vrfy(config("display",2) == 20, '542: config("display",2) == 20'); vrfy(config("leadzero",0) == 1, '543: config("leadzero",0) == 1'); vrfy(config("fullzero",1) == 0, '544: config("fullzero",1) == 0'); vrfy(strprintf("%d %d %d", 0, 1, 2) == ".00 1.00 2.00", '545: strprintf("%d %d %d", 0, 1, 2) == ".00 1.00 2.00"'); vrfy(config("display",20) == 2, '546: config("display",20) == 2'); vrfy(config("leadzero",1) == 0, '547: config("leadzero",1) == 0'); vrfy(config("fullzero",0) == 1, '548: config("fullzero",0) == 1'); vrfy(strprintf("%d %d %d", 0, 1, 2) == "0 1 2", '549: strprintf("%d %d %d", 0, 1, 2) == "0 1 2"'); /* restore calling config */ vrfy(config("all",callcfg) == startcfg, '550: config("all",callcfg) == startcfg'); vrfy(config("all") == callcfg, '551: config("all") == callcfg'); vrfy(config("all") == startcfg, '552: config("all") == startcfg'); /* check read-only config values */ vrfy(strlen(config("program")) > 0, '553: strlen(config("program")) > 0'); vrfy(strlen(config("basename")) > 0, '554: strlen(config("basename")) > 0'); vrfy(strlen(config("version")) > 0, '555: strlen(config("version")) > 0'); /* mode2 is off by default */ vrfy(config("mode2") == "off", '556: config("mode2") == "off"'); /* hz is numeric */ vrfy(isint(config("hz")), '557: isint(config("hz"))'); /* compile_custom is simple */ vrfy(issimple(config("compile_custom")), '558: issimple(config("compile_custom"))'); /* allow_custom is simple */ vrfy(issimple(config("allow_custom")), '559: issimple(config("allow_custom"))'); /* allow_custom is simple */ vrfy(issimple(config("allow_custom")), '559: issimple(config("allow_custom"))'); /* baseb is numeric */ vrfy(isint(config("baseb")), '560: isint(config("baseb"))'); /* redecl_warn is simple */ vrfy(issimple(config("redecl_warn")), '561: issimple(config("redecl_warn"))'); /* dupvar_warn is simple */ vrfy(issimple(config("dupvar_warn")), '562: issimple(config("rdupvar_warn"))'); print '563: Ending test_config'; } print '010: parsed test_config()'; /* * Do multiplication and division on three numbers in various ways * and vrfy the results agree. */ define muldivcheck(a, b, c, str) { local abc, acb, bac, bca, cab, cba; abc = (a * b) * c; acb = (a * c) * b; bac = (b * a) * c; bca = (b * c) * a; cab = (c * a) * b; cba = (c * b) * a; if (abc != acb) {print '**** abc != acb:', str; ++prob;} if (acb != bac) {print '**** acb != bac:', str; ++prob;} if (bac != bca) {print '**** bac != bca:', str; ++prob;} if (bca != cab) {print '**** bca != cab:', str; ++prob;} if (cab != cba) {print '**** cab != cba:', str; ++prob;} if (abc/a != b*c) {print '**** abc/a != bc:', str; ++prob;} if (abc/b != a*c) {print '**** abc/b != ac:', str; ++prob;} if (abc/c != a*b) {print '**** abc/c != ab:', str; ++prob;} print str; } print '011: parsed muldivcheck(a, b, c, str)'; /* * Use the identity for squaring the sum of two squares to check * multiplication and squaring. */ define squarecheck(a, b, str) { local a2, b2, tab, apb, apb2, t; a2 = a^2; b2 = b^2; tab = a * b * 2; apb = a + b; apb2 = apb^2; if (a2 != a*a) {print '**** a^2 != a*a:', str; ++prob;} if (b2 != b*b) {print '**** b^2 != b*b:', str; ++prob;} if (apb2 != apb*apb) { print '**** (a+b)^2 != (a+b)*(a+b):', str; ++prob; } if (a2+tab+b2 != apb2) { print '**** (a+b)^2 != a^2 + 2ab + b^2:', str; ++prob; } if (a2/a != a) {print '**** a^2/a != a:', str; ++prob;} if (b2/b != b) {print '**** b^2/b != b:', str; ++prob;} if (apb2/apb != apb) {print '**** (a+b)^2/(a+b) != a+b:', str; ++prob;} if (a2*b2 != (a*b)^2) {print '**** a^2*b^2 != (ab)^2:', str; ++prob;} print str; } print '012: parsed squarecheck(a, b, str)'; /* * Use the raising of numbers to large powers to check multiplication * and exponentiation. */ define powercheck(a, p1, p2, str) { local a1, a2, a3; local b1, b2, b3; a1 = (a^p1)^p2; a2 = (a^p2)^p1; a3 = a^(p1*p2); b1 = (a**p1)**p2; b2 = (a**p2)**p1; b3 = a**(p1*p2); if (a1 != a2) {print '**** (a^p1)^p2 != (a^p2)^p1:', str; ++prob;} if (a1 != a3) {print '**** (a^p1)^p2 != a^(p1*p2):', str; ++prob;} if (b1 != b2) {print '**** (b^p1)^p2 != (b^p2)^p1:', str; ++prob;} if (b1 != b3) {print '**** (b^p1)^p2 != b^(p1*p2):', str; ++prob;} print str; } print '013: parsed powercheck(a, p1, p2, str)'; /* * Test fraction reductions. * Arguments MUST be relatively prime. */ define fraccheck(a, b, c, str) { local ab, bc, ca, aoc, boc, aob; ab = a * b; bc = b * c; ca = c * a; aoc = ab / bc; if (num(aoc) != a) {print '**** num(aoc) != a:', str; ++prob;} if (den(aoc) != c) {print '**** den(aoc) != c:', str; ++prob;} boc = ab / ca; if (num(boc) != b) {print '**** num(boc) != b:', str; ++prob;} if (den(boc) != c) {print '**** den(boc) != c:', str; ++prob;} aob = ca / bc; if (num(aob) != a) {print '**** num(aob) != a:', str; ++prob;} if (den(aob) != b) {print '**** den(aob) != b:', str; ++prob;} if (aob*boc != aoc) {print '**** aob*boc != aoc;', str; ++prob;} print str; } print '014: parsed fraccheck(a, b, c, str)'; /* * Test multiplication and squaring algorithms. */ define algcheck(a, b, str) { local ss, ms, t1, t2, t3, t4, t5, t6, t7; local a1, a2, a3, a4, a5, a6, a7; local oldmul2, oldsq2; oldmul2 = config("mul2", 2); oldsq2 = config("sq2", 2); a1 = a * b; a2 = a * a; a3 = b * b; a4 = a^2; a5 = b^2; a6 = a2^2; a7 = pmod(3,a-1,a); for (ms = 2; ms < 20; ms++) { for (ss = 2; ss < 20; ss++) { config("mul2", ms); config("sq2", ss); t1 = a * b; t2 = a * a; t3 = b * b; t4 = a^2; t5 = b^2; t6 = t2^2; if (((ms + ss) % 37) == 4) t7 = pmod(3,a-1,a); if (t1 != a1) {print '**** t1 != a1:', str; ++prob;} if (t2 != a2) {print '**** t2 != a2:', str; ++prob;} if (t3 != a3) {print '**** t3 != a3:', str; ++prob;} if (t4 != a4) {print '**** t4 != a4:', str; ++prob;} if (t5 != a5) {print '**** t5 != a5:', str; ++prob;} if (t6 != a6) {print '**** t6 != a6:', str; ++prob;} if (t7 != a7) {print '**** t7 != a7:', str; ++prob;} } } config("mul2", oldmul2); config("sq2", oldsq2); print str; } print '015: parsed algcheck(a, b, str)'; /* * Test big numbers using some identities. */ define test_bignums() { local a, b, c, d; print '600: Beginning test_bignums'; a = 64357824568234938591; b = 12764632632458756817; c = 43578234973856347982; muldivcheck(a, b, c, '601: muldivcheck 1'); a = 3^100; b = 5^97; c = 7^88; muldivcheck(a, b, c, '602: muldivcheck 2'); a = 2^160 - 1; b = 2^161 - 1; c = 2^162 - 1; muldivcheck(a, b, c, '603: muldivcheck 3'); a = 3^35 / 5^35; b = 7^35 / 11^35; c = 13^35 / 17^35; muldivcheck(a, b, c, '604: muldivcheck 4'); a = (10^97-1) / 9; b = (10^53-1) / 9; c = (10^37-1) / 9; muldivcheck(a, b, c, '605: muldivcheck 5'); a = 17^50; b = 19^47; squarecheck(a, b, '606: squarecheck 1'); a = 2^111-1; b = 2^17; squarecheck(a, b, '607: squarecheck 2'); a = 23^43 / 29^43; b = 31^42 / 37^29; squarecheck(a, b, '608: squarecheck 3'); a = 4657892345743659834657238947854639; b = 43784356784365893467659347867689; squarecheck(a, b, '609: squarecheck 4'); a = (10^80-1) / 9; b = (10^50-1) / 9; squarecheck(a, b, '610: squarecheck 5'); a = 101^99; b = 2 * a; squarecheck(a, b, '611: squarecheck 6'); a = (10^19-1) / 9; vrfy(ptest(a, 20), '612: primetest R19'); a = (10^23-1) / 9; vrfy(ptest(a, 20), '613: primetest R23'); a = 2^127 - 1; vrfy(ptest(a, 1), '614: primetest M127'); a = 2^521 - 1; vrfy(ptest(a, 1), '615: primetest M521'); powercheck(17, 127, 30, '616: powercheck 1'); powercheck(111, 899, 6, '617: powercheck 2'); powercheck(3, 87, 89, '618: powercheck 3'); fraccheck(3^200, 5^173, 7^138, '619: fraccheck 1'); fraccheck(11^100, 12^98, 13^121, '