SuperADD | MDT Tool that names computer , joins to domain | Machine Learning library
kandi X-RAY | SuperADD Summary
kandi X-RAY | SuperADD Summary
MDT Tool that names a computer, joins to a domain in a specified OU, and adds a description.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SuperADD
SuperADD Key Features
SuperADD Examples and Code Snippets
Community Discussions
Trending Discussions on SuperADD
QUESTION
I'm making an idle/click game in unity, and have a custom format that I'd like all the numbers in the game to display as. K for thousands, M for millions, B for billions, etc. See below example from a game called Tower of Heroes.
The displaying of these numbers and units works great. However, where I am running into an issue is with my decision to have arbitrarily large numbers in the game. I did not want to be limited by the constraints of double, and wanted the challenge of coming up with my own solution. I was able to do so, and even get most math operations to work with my solution. Addition, subtraction, multiplication, and exponents all work well enough. But I cannot figure out the logic/math for division...
So, I am using a list of doubles for each of my game variables.
Example: List money = new List();
would be a list containing the money the player currently has. Every position is limited to 0-999. Position 0 represents the "1's", position 1 the thousands, position 2 the millions, etc, with the list growing as large as it needs to. So if we had:
ANSWER
Answered 2019-Aug-17 at 22:02If you want to keep your custom formatting and not switch to BigInteger, there might be a viable way to divide by using your existing addition and subtraction operators.
Since your values are stored in a list of integers, you should run through that list for each number and perform long divison. I'm on my phone so I can't provide a code example, but the logic is somewhat straightforward.
https://en.wikipedia.org/wiki/Long_division
Let's say the calculation is 300/20
First step is to find the first subset of 300 that is equal to or larger than the 20. That will be 30.
Then you find the qoutient and calculate the remainder, which is 1 and 10 respectively.
You then append the next number from the 300 (which is a 0) to the remainder (10). This will give you 100. Then you do the same thing resulting in a qoutient of 5 and remainder of 0.
The remainder being zero means that the calculation is complete. Then you append all the qoutients you've calculated and you have the result ("1" + "5" = "15")
For finding the qoutient and remainder you can use Euclidean Division that also only uses your existing addition and subtraction operators. https://en.wikipedia.org/wiki/Division_algorithm N / D = (Quotient, Remainder)
Algorithm:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SuperADD
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page