Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Xylph · Feb 03, 2015 at 11:41 AM · data storagedatatype

Storing insanely large numbers

I would like to get input from you on how to store insanely large numbers. By insanely large, I'm thinking of numbers that can go up to 100 zeros.

I've read about BigInteger it's not available in .NET 2.0. I'm wondering if I need to build my own struct to support this feature.

Thanks!

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Feb 03, 2015 at 12:39 PM 1
Share

It's gotta be asked... why?

avatar image Bonfire-Boy · Feb 03, 2015 at 01:03 PM 1
Share

Also... what? As in, what do you want to be able to do with them?

avatar image daneislazy · Feb 03, 2015 at 02:00 PM 2
Share

If you just want to "store" the number, just use a string. If you want to be able to use the number to do calculations or something, you are not going to be able to do anything without a very creative/tedious solution. the why and what questions are really bugging me too

avatar image Bonfire-Boy · Feb 03, 2015 at 02:08 PM 0
Share

And if you want to be able to do calculations, then to what level of precision? (I'm thinking of doubles here...)

avatar image Bonfire-Boy · Feb 03, 2015 at 04:48 PM 1
Share

Quite, this is why my bringing doubles into the picture was linked to the questions about what they wanted to do with their numbers. I think it also under$$anonymous$$es the "insanely large" idea. If we're talking about being able to use distinct integers with 300+ digits then it's the precision that's insane, not the size.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Feb 03, 2015 at 02:46 PM

http://answers.unity3d.com/questions/355810/bigintegerbigrational.html

http://answers.unity3d.com/questions/890835/biginteger-in-unity3d.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by hav_ngs_ru · Feb 03, 2015 at 02:58 PM

you could make your own InsanelyBigInt class, where data stored like int[] data. as far as Int capacity is 2,147,483,647 , each data[i] element would represent a MegaDigit.

e.g. if data[1]=222333444 and data[1]=555666777, that the real value is 222333444555666777. with unlimited number of data[] items you could store numbers with up to million digits.

but:

  1. you will have to define all operations on this class (+, -, *, /, =, ==, !=) and .ToString and .Parse methods, and conversion to/from int type at least (to be able input, output and operate them).

  2. and the second thing... really, WHAT FOR??? :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Stored data and GameObject 1 Answer

Scriptable objects become volatile on android 1 Answer

[AssetsBundle] How to keep an AssetBundle on device after the download 1 Answer

Simple way to change data online for customers 1 Answer

Unity WebGL form posts to Cloud Firestore with Firebase JS SDK 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges