(post deleted by author)
C# has the built in Math class for dealing with doubles. Unity’s Mathf only deals with floats:
I’m not sure what there is to explain that the docs don’t already explain:
The first parameter is the base, the second is the exponent, and it returns the result.
Double D = System.Math.Pow(X,N); ?
Or
D = System.Math.Pow(D,-3)
?? If you have an instance where you need to use math pow on a double you’ll generally know at this point when and where you need to use it.
Power only works up to 90. You can’t ask for power of greater than 90 and obtain a decimal result. Maybe you can another way but not for a decimal.
So let’s say you wrote your own power algorithm, and you wanted to power 2.5 and scaled it to 250, to then divide back down at the end of it, the power of all values double float long is unobtainable. Using the divide and conquer method of obtaining power algorithm instead of the for loop to obtain power as an alternative to math power does not provide the functionality required.
you simply cannot obtain value with power greater than 90, so when and where to use it?
if the power of 2, is less than 90
^^^
Show example of code you have or any current attempt you’ve got
Meanwhile I was wrong in my previous post
There are bigger decimals
Don’t retype code. Instead copy/paste it. It’s obvious that MOST of the above lines won’t even compile (at least SIX lines of code have no semicolon at the end!!!), so how can anyone here give you accurate info on how to fix it?
Yes but what does “raise a double value” even mean??
Mathf.Pow() (and Math.Pow()) will raise any f to the power of p, as liberally documented all over the place:
https://docs.unity3d.com/ScriptReference/Mathf.Pow.html
https://docs.microsoft.com/en-us/dotnet/api/system.math.pow?view=net-6.0
That’s just math. It works, we know it works, if it doesn’t work for you it is because you’re not feeding it the data you expect. There’s literally nothing else to add to it.
Beyond that, what is your actual question? Are you asking about the math behind an idle clicker? If so that has nothing to do with Unity and everything to do with basic clicker game design, about which there are copious videos explaining it.
If your question is actually something Unity related, here is how to report your problem productively in the Unity3D forums: