
6 Jun
2019
6 Jun
'19
4:12 p.m.
Hello Sergej, On Thu, Jun 06, 2019 at 09:06:00PM +0200, Sergej KAREL wrote:
Hello, Im looking for setting up a solver for the determination of digit on N-th position of the high value number
The trick is to only take the appropriate reminder instead of the whole multiplication result. Something like: λ> myMult x y = rem (x * y) 100 λ> :t +d foldr1 foldr1 :: (a -> a -> a) -> [a] -> a λ> myPower x y = foldr1 myMult (replicate y x) λ> myPower 9 9 89 λ> 9^9 387420489 λ> myPower 9 (myPower 9 9) 89 Does this help? -F