- Home /
Big double values show as "infinity" in Android
Hi, I created a small idle game for Unity. I'm using doubles for big numbers. When I play the game on Unity editor, it's fine, but the problem is, when I build and run the program in an Android device, the doubles that have big values (I think the limit is something close to 1E+15) show as "infinity". Here are some screenshots:
This is how it looks on Unity editor:
And this is the Android one:
So, I know the biggest double value is 1.7976931348623157E+308
as it is stated here, but as you can see, it doesn't show those big numbers. Does anyone know why?
Thanks in advance.
Your screenshots are not accessible for me (its jsut text, no link). Why do you need those big numbers? If those numbers are positions you will realise that using such large numbers will result in big imprecisions.
Answer by Bunny83 · Apr 29, 2018 at 10:59 AM
My guess is that somewhere in your calculation you actually divide by zero. It's one of the rare cases which will actually lead to infinity. From your screenshots it's nor clear where the value comes from. Also the value that you show on the screen shots is "83.7" so it's not really a "huge number". So if the actual value is quite large there has to be some math involved. Show us your code or we can't help you any further.
Hi, as you can see the number is actually "83.7 ak" which equals to something like 8.37 * 10^46.
Here is my code: https://hastebin.com/dicohelasi.cs
Since my code is too long, here is my related part of the code: https://hastebin.com/ejuripiboz.cs
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Input.GetMouseButtonDown() slow on mobile 2 Answers
Using GUI buttons to move a sprite (C#) 2 Answers
How to pass Java object to C#? 2 Answers