Raised This Month: $51 Target: $400
 12% 

[get_*cvar_num] returns incorrect result for high values


  
 
 
Thread Tools Display Modes
Author Message
VEN
Veteran Member
Join Date: Jan 2005
Old 01-01-2007 , 23:35   [get_*cvar_num] returns incorrect result for high values
#1

I havent tested much values but:
Code:
new pcvar = register_cvar("cvar_33554431", "33554431") server_print("cvar_33554431: %d   %d", get_cvar_num("cvar_33554431"), get_pcvar_num(pcvar))

Outputs:
Code:
cvar_33554431: 33554432   33554432
Though check in console results in output:
Code:
"cvar_33554431" is "33554431"
The same test for example for value 16777215 is ok.
VEN is offline
sawce
The null pointer exception error and virtual machine bug
Join Date: Oct 2004
Old 01-25-2007 , 23:51   Re: [get_*cvar_num] returns incorrect result for high values
#2

This is fixed in revision 3261

Upon further review, the overhead added for such a core function was just too great for this change to go for such a stupidly rare rounding error. If anybody needs accurate results, they should either not use cvars for storage, or use str_to_num() to convert the value from the string value.
__________________
fyren sucks

Last edited by sawce the snail; 06-24-2007 at 23:18.
sawce is offline
 



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 -4. The time now is 01:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode