Fibonacci giving strange output if giving large numbers.
Describe the bug
In Fibonacci, all the functions are taking input as int and give output as int. But if we give a big int as input the corresponding Fibonacci number will not fit inside an int variable.
output datatype should be as large as it can, like long.
though long also can't fit output for very very large int. Considering that if the input is large enough that the output will not fit inside a long variable, rather than giving the wrong output, it should specify that the input is too large for this algorithm to be performed.
Also need some more test cases.
Or we could use BigNumbers there, both options are fine IMO
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
i guess if we can store the answer in an array... example: answer of 77th fibonacci number is 5527939700884757. we can store it like {5,5,2,7,9,3,9,7,0,0,8,8,4,7,5,7} and later on print array as our answer. we remain confined to range of long data type and print appropriate message...
True is
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!