You could implement floating point numbers or long integers manually, but it might be easier to just divide everything by 5000. After all, in real life, there's no way that reactors would be anywhere close to that cheap.

You might be able to do a base-10 floating point number, so long as you don't need to multiply or divide the price. You would have 3 bytes of number, and then a byte that represents the number of zeroes after it. That way, you will always be able to have at least 6 digits of precision. It would also make it easy to say "12.3456 billion," for example. When adding two numbers with the same exponent, you would just have to make sure that if the result goes over 2^23, that it is divided by 10 and the exponent is increased. Multiplication and division are obviously harder. If two numbers have a different exponent, divide the number part of the one with the smaller exponent by 10 the same number of times as the difference between the two exponents and set the exponent to be the same as the higher one's, then add them normally.
Hmm... the dividing by 5000 seems like a good idea, I could probably also implement a counter of everything that isn't 5000, ex: 5700 would be 1 in the min counter, and 700 in the reserve so 5x1000+700. I will probably add in a warning into the intro that describes this div by 5k thing...
More progress!

Feedback?
Nice, looks very polished. I might recommended making the font bigger in the actual simulation part though.
I might, depending on how much stuff gets put on screen (probably a lot, so I'll just keep it at Scale(1,1) though)
It would be actually not 3 bytes of number, but 4 ... isn't it? And then 2 bytes that represent the number of zeroes after! Do you calculate your finances or what?

edited by an admin to remove spam links.
Progress (or lack of) report: AP season is coming up, and I'll have to put this on the (very) back burner for now. If I can't get this done before the end of CC22, i'll just finish this and release it as normal...

EDIT: Thought this ends on May 31st... DEFINITELY won't have time to finish this, unfortunately... Sad
Yeah, confirmed that I will NOT be able to get this done on time and still be able to study for my AP's, I'll probably release this later on as a regular program, though...
Wish me luck on my AP's...
AP's are over... now for my SAT in June...

Anyhow, I think I'll (try) to rewrite/ finish this in C, instead of ICE, and release it as a normal program...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
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
You cannot vote in polls in this forum

 

Advertisement