forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Incorrect math with -32767

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
gonzabar
Newbie


Joined: 24 Jun 2001
Posts: 15
Location: Madrid, Spain

PostPosted: Thu Jun 19, 2003 9:42 am    Post subject: Incorrect math with -32767 Reply with quote

TITLE non-numeric?(VDS4) or incorrect sum(VDS5)
%A = -32767
if @not(@numeric(%A))
info %A is non-numeric value (if VDS4)
end
%C = @sum(%A,5)
INFO (VDS5) Incorrect: %C Correct: @diff(5,32767)
exit

If %A not equal -32767, result is OK.
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Jun 20, 2003 3:35 pm    Post subject: Reply with quote

I'm not sure why @SUM() no longer returns an error in VDS 5. Anyway you could
use the floating point functions for working with large numbers, eg. @FADD() and
@FSUB().
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DavidR
Contributor
Contributor


Joined: 05 Aug 2003
Posts: 83
Location: Bethel Pennsylvania U.S.A.

PostPosted: Mon Sep 29, 2003 12:27 pm    Post subject: Re: Incorrect math with -32767 Reply with quote

gonzabar wrote:
TITLE non-numeric?(VDS4) or incorrect sum(VDS5)
%A = -32767
if @not(@numeric(%A))
info %A is non-numeric value (if VDS4)
end
%C = @sum(%A,5)
INFO (VDS5) Incorrect: %C Correct: @diff(5,32767)
exit

If %A not equal -32767, result is OK.


OUCH! This one bit me as well. This code works as expected in 3.5 and 4.x but not in VDS5 Sad Hopefully this will be fixed ?
It's a lot nicer to be able to use @OK to determine if a valid variable was used but @SUM in VDS5 returns OK not matter what you feed it.

%A = nonsense
%S = @SUM(%A,10)
IF @OK()
INFO Operation OK! %S
ELSE
WARN Operation failed!
END
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group