taeh98 / fibonacci Goto Github PK
View Code? Open in Web Editor NEWA simple Java CLI program to count to a specified term in the Fibonacci sequence.
A simple Java CLI program to count to a specified term in the Fibonacci sequence.
The for loop for printing the whole Fibonacci sequence to a given term number is not working. I think it's at least partly due to the failure for the i value in the loop, representing the term number, to increase over each loop. When I work on the code again tomorrow, I'll try to fix this, and fully transition from using a for loop to find the value of a specified term number to using a formula, using Phi or root 5.
Due to integer overflows (if you don't know basically when a number exceeds the maximum size for the data type being used - https://en.wikipedia.org/wiki/Integer_overflow), the program can currently only run to the 92nd term. This is because after that the numbers generated exceed the maximum values for the long types I'm currently using to represent the numbers being added.
To fix this, I'm going to convert from using longs to using BigIntegers instead. I think that has a possibility of crashing the computer though because, as the name suggests, they can get quite big. Maybe I can put a limit on the time to run the for loop once? Or ideally the strain on hardware (like the CPU) and the state of the memory being used by Java. That's probably pretty difficult to implement though, so maybe just a maximum number of terms/loops (but that surely defeats the purpose of the program?).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.