I'm guessing Fin has but have any of you used linked lists for maths with large numebrs before?
I kind of invented the idea before I knew what linked lists were and now I've realised that it's actually fairly easy (ish) to do.
Purely as an exercise I'm going to try create a largeNumber class that eclusively uses linked lists and has methods for operating on them.
Will also be very useful for keeping for future code as I have been stuck in the past whenever it comes to very large numbers.
I realise there are libraries out there for this already but I'm doing it as a learning exercise also.
What language? I'd look at the BigInt class as an example, I'm not sure if a linked list is the most effective way depending on the calculations
_________________ Twitter Charlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
I used it for a few of the tasks on Project Euler as it's a really useful library to have around for things like that
_________________ Twitter Charlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
If it was a little smarter it could quickly evaluate 1000!/999! = 1000 based on evaluation
_________________ Twitter Charlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
I knew it was working properly. But the numbers being used in the large version of (minimum scalar product) were too big and it was messing up the result.
Users browsing this forum: No registered users and 12 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum