Find the previous fibonacci number | Function to return the previous fibonacci number ; Driver code
function previousFibonacci ( n ) { var a = n / ( ( 1 + Math . sqrt ( 5 ) ) / 2 ) ; return Math . round ( a ) ; } var n = 8 ; document . write ( previousFibonacci ( n ) ) ;