Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
tjpc3

How to exceed te maxiumum numbers allowed by Lua?

Question

I'm a situation where I'm writing programs that do arithmetic on large numbers for encryption. However, Lua hates large numbers and changes any number that is 2^1024 or over. Is there any addon or something else that I could use to bypass this?

 

Example:

print(4265 ^ 6219)

> inf

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Not really. Lua uses 64-bit signed integers as long as possible (unless you force floating-point numbers by writing 4265.0 instead of 4265) and switches to double-precision floats for anything outside of that range. And if you exceed that range, then you get float infinity.

 

If you're doing cryptography, you might want to look at the Data Card though. If I remember correctly the higher tiers provide some cryptographic functions too.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.