fork download
  1. main = print $ myfib 1000000
  2.  
  3. myfib n = round $ (1 / sq5) * ( (s (+)) - (s (-)))
  4. where
  5. s op = ((1 `op` sq5)/2)^(n+1)
  6. sq5 = sqrt 5
Success #stdin #stdout 0s 6228KB
stdin
Standard input is empty
stdout
179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216