harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:30 AM |
Inspired by this btc boom, I am trying to do some RSA in ROBLOX. After a few minutes, I realized that Lua could not handle large numbers (155 digits+) and simply 'rounded up' to infinity.
Does anybody know a way around it? |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 03:35 AM |
| Your computer can't handle numbers like that. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:38 AM |
I decided to start using smaller numbers, 11, 13, 17
d=11^13^17
Still insanely large, but my computer CAN handle it. In this case it's definitely Lua's fault. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 03:40 AM |
| No, google binnary. Every calculator(computer in nutshell) has limit. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:44 AM |
| My calculator on my computer could compute 11^13^17 while Lua can't. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 03:50 AM |
| Well, probably Lua can't access enough memory for that huge numbers. And why would you ever need numbers like that? |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 03:53 AM |
| You could store value on string, but you'd need to find way, how you'd calculate and save with system like that. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:54 AM |
| RSA is often called public-key cryptography. It uses very large numbers. Bitcoin uses it. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:55 AM |
| That's a good idea, not sure how I'd work it though. In the end I would have to use maths at one point (I think) so maybe not. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 03:57 AM |
| Try doing math in binnary, then find way how to convert it to numbers. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
|
| 05 Apr 2013 03:59 AM |
I suppose that would work. The way I'm thinking, it would involve having a table full of 'true's and 'false's. Don't think I'm good enough at maths, though.
Thanks for the help, btw. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Apr 2013 04:01 AM |
| I'll ask dr01d about this. He is great at creating algebric classes for Lua. |
|
|
| Report Abuse |
|
|
harryx
|
  |
| Joined: 25 Oct 2008 |
| Total Posts: 3209 |
|
| |
|
lah30303
|
  |
| Joined: 15 Feb 2008 |
| Total Posts: 10027 |
|
|
| 05 Apr 2013 05:05 AM |
| You could look up the source code for Java's BigInteger class and try to make something similar to that. I think it has something to do with having an array of integer values, and the actual value is the addition of all those values. I'm not certain. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 05 Apr 2013 05:33 AM |
| Your some years off, but, unlike you, idgaf about your life. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 05 Apr 2013 07:23 AM |
Why would zars not care about his life? Why would you even care? Why are you still posting? |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2013 07:28 AM |
Take a few integers of a certain length, line them up, and connect the ends. Boom, bigger numbers.
This is a completely unsarcastic response, but I'm withholding some information for you to figure out. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 05 Apr 2013 07:33 AM |
By the way, the biggest possible number for Roblox (to print without getting inf) is
179769313486230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
As for your question - data types have limits, Roblox uses doubles and floats. |
|
|
| Report Abuse |
|
|
oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
|
| 05 Apr 2013 07:34 AM |
| Myrco, he is just your fan =D! Spamming the forum! |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2013 07:40 AM |
You can make integers as big as you want as long as you have the RAM to store them, and the patience to process them.
Figuring out how to do math with these bigger integers probably wouldn't be much fuss either. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 05 Apr 2013 07:42 AM |
@awsum: Indeed.
Let's ship some yottabytes lol. |
|
|
| Report Abuse |
|
|