Integer/Floating Point Ranges and Precision

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
BillJames
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9
Joined: Tue Feb 10, 2009 2:14 am

Integer/Floating Point Ranges and Precision

Post by BillJames » Tue Jan 26, 2010 3:09 am

I looked in the user guide, dictionary, and searched the forums but I cannot find a discussion of number ranges or digits of precision. I understand that the language is typeless, but you would expect at least some discussion on this topic. I tried some testing on integers and was surprised to find that you can do the below:

put 2 ^ 500 into tInt

Does this mean that there is variable precision built into revolution math? It appears so.

Can the digits of precision for floating point math be set as well?

Thanks,

Bill

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Integer/Floating Point Ranges and Precision

Post by Mark » Fri Jan 29, 2010 7:30 pm

Hi BIll,

Off the top of my head, I believe that Revolution can't handle any numbers larger than 2^52 (or 2^53?). RunRev is not a scienticif/medical/military calculation tool. 2^500 does return a number, but put (2^500)-(2^500-1) returns 0 instead of 1. Apparently, such calculations make no sense in Revolution.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”