huge numbers

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
soullessbr
Prole
Posts: 11
Joined: Sat Jun 01, 2013 1:18 am

huge numbers

Post by soullessbr »

Hello people, can someone show me how to work with those giant numbers that use idle games?

ty! :cool: :cool: :cool: :cool:
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: huge numbers

Post by Sulunia »

Image

I'll just assume you want to print to console or game window a huge number without scientific notation. Then, i guess that would be:

Code: Select all

love.graphics.print(string.format("%.0f", variable))
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: huge numbers

Post by Tanner »

You'll want to use a library that represents those numbers as a combination of Lua primitive values. Something like this: https://bitbucket.org/tedu/bigintlua/src/tip/bigint.lua
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: huge numbers

Post by zorg »

If your huge numbers are "whole", that is, they have nothing after a decimal... point, comma or whatever symbol you might use, and they fit inside the double datatype lua (and löve) uses (that is, if the numbers are smaller than 2^53, or 9 007 199 254 740 992) then use what Sulunia suggested, otherwise you can use what Tanner linked.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 5 guests