[Ilugc] factorial

  • From: goda.abishek@xxxxxxxxx (Abishek Goda)
  • Date: Mon, 28 Feb 2011 18:31:25 +0530

Hi,

Hi,
? ? ? ? ? ? ? Anyone knows how to find the factorial of a number without
using loops , arithmetic operator,case structure.I guess that this has to be
done by using bitwise operator.but i dont know how.

extremely long drawn, but possibly something along the asm lines?

you could increment using the or/xor operation, multiply by repeated
addition (which again is xor) operations. subtract with xor
operations. essentially, you would be rewriting every arithmetic is
the least arithmetic way possible.

but do keep this thread posted if there really is a simpler such
solution. would love to know :)

abishek

Other related posts: