Always learn from ones mistakes. so revised to be below , but I'm not saying it is better than yours
just different.
MAX_EDIT_FIELDS = 361;
srand(_rdtsc());
_iResult = (rand() > (RAND_MAX/2) ? (rand() % MAX_EDIT_FIELDS) : -1*(rand() % MAX_EDIT_FIELDS);
corrected typo:
_iResult = (rand() > (RAND_MAX/2) ? (rand() % MAX_EDIT_FIELDS): -1*(rand() % MAX_EDIT_FIELDS));
----------------
output
-59, -90, 27, -123, 104, -187, 306, 102, 257, -345, 13, -349, -134, 181, 238, -8, 154, -30, 99, -170, 163, -171, 91, 331, -25, 201, 121, -66, 320, 33, -118, -108, -146, -6, 129, 210, 128, 129, -125, -222, 235, -273, 113, -99, -15, 36, 282, -50, 163, -284, -37, -148, -8, 143, 329, -44, -267, 235, -91, 215, 17, 308, -18, 22, -49, -88, -326, -126, 112, -174, 244, -65, 318, 104, 315, -267, -89, 252, -31, -2, -86, -189, -302, 110, 260, 296, 274, -64, 57, -43, 279, 308, -283, 161, -274, -166, -53, 136, -29, -1, -285, 78, 316, 49, -64, 300, 297, 232, -85, -20, -275, 18, 107, -132, 268, 81, 71, -42, -72, 87, 198, -226, -187, 24, 167, 69, 209, -84, -214, 256, -179, 255, -287, -165, 28, -331, 2, -293, -177, 272, -170, 312, 119, -218, 110, 355, 205, -75, -176, 344, -159, -32, -274, 283, 325, -6, -229, -42, -227, -8, -358, 245, -101, 353, 307, -190, -293, -131, -341, -315, 0, 150, 12, -215, -3, -319, 203, -14, 225, 147, 107, -118, 253, 314, -10, -321, -3, 247, -1, 321, 311, 43, 349, 54, -342, 358, 204, 100, 1
John Z