Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Bug Report
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 13 votes, 4.69 average. Display Modes
  #1  
Old 05-18-2010, 04:24 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I'm currently having issues with a scripted timevar3 system, and have narrowed it down to the math involving large numbers to be at fault.

PHP Code:
//#CLIENTSIDE

function onCreated() {
  for (
temp.1temp.10temp.i++) {
    
this.scheduleevent(temp.i"MathBug""");
  }
}

function 
onMathBug() {
  
temp.largeNumber 1274191251.03// example server-side timevar2
  
echo("=========================");
  echo(
temp.largeNumber);
  echo(
timevar2);
  echo(
temp.largeNumber+timevar2);

Log:

PHP Code:
=========================
1274191251.029999972
186.784149184
1274191488
Should of been
1274191437.814149156
=========================
1274191251.029999972
187.783325184
1274191488
=========================
1274191251.029999972
188.781326272
1274191488
=========================
1274191251.029999972
189.77952576
1274191488
=========================
1274191251.029999972
190.77836608
1274191488
=========================
1274191251.029999972
191.776428224
1274191488
=========================
1274191251.029999972
192.774490368
1274191488
=========================
1274191251.029999972
193.773513792
1274191488
=========================
1274191251.029999972
194.78767392
1274191488 
__________________
Quote:
Reply With Quote
  #2  
Old 05-18-2010, 08:49 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by fowlplay4 View Post
I'm currently having issues with a scripted timevar3 system, and have narrowed it down to the math involving large numbers to be at fault.
This is not really a bug though. The maximum integer value that Graal supports is 2^32, which is 1274191488, due to memory restrictions.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 05-18-2010, 08:52 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I had issues doing comparisons of larger numbers with V6 client. Skyld showed me that comparing them as strings fixes the issue.
Reply With Quote
  #4  
Old 05-18-2010, 08:53 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Twinny View Post
I had issues doing comparisons of larger numbers with V6 client. Skyld showed me that comparing them as strings fixes the issue.
Yes, the limit for strings is much larger than for integers.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #5  
Old 05-18-2010, 11:11 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Maybe some arbitrary-precision arithmetic is in order? I'm not sure how this would be handled due to GS2's dynamic typing though -- it could be a very hard-to-find bug if your script suddenly slows down once the numbers go above 2^32.
Reply With Quote
Reply

Tags
graal v6, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.