
24 Mar
2004
24 Mar
'04
2:49 p.m.
On Thu, Mar 25, 2004 at 01:38:44AM +1100, Alex Gontcharov wrote:
Hi,
I am new to haskell and would look to write a function equivalent to the following loop in C
int value = 500000; int part_stack[4]; int *part_ptr = part_stack; for (; value; value /= 10000) *part_ptr++ = value % 10000;
part_stack :: [Int] part_stack = [0,50] Note that I've performed a memoization optimization--this makes the code both smaller, faster and easier to read! :P But seriously, the C code doesn't do anything. Why do you want to translate it? (Unless it's homework...) -- David Roundy http://www.abridgegame.org