Check_Item Is Always Equal To 0 When 2^32

Sergio NNX sfhacker at hotmail.com
Thu Oct 24 16:39:29 CEST 2013


> Not sure where you got these from.
> 
> 6GB = 6 * 1024 * 1024 * 1024 = 4 * 1024^3 = 6442450944
> 
> 6GB in binary is
> 
> 0000000000000000000000000000000110000000000000000000000000000000
> 
> 3210987654321098765432109876543210987654321098765432109876543210
>    6         5         4         3         2         1         0
> 
> So the lower 32 bits are:
> 
> 10000000000000000000000000000000
> 
> and the upper 32 bits are:
> 
> 00000000000000000000000000000001
> 
> The lower bits can be found by bitwise AND with (2^32)-1 (i.e. 32
> ones):
> 
> $ python
> >>> 6*(1024**3) & ((2**32)-1)
> 2147483648
> 
> The upper 32 bits by shifting right by 32 bits:
> 
> >>> 6*(1024**3) >> 32
> 1
> 
> 
> So you want 
> 
> > i put 536870912 in ChilliSpot-Max-Input-Octets
> 
> this should be 2147483648;
> 
> > i put 268435456 in ChilliSpot-Max-Input-Gigawords
> 
> This should be 1.

This reminds me my university time!
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20131024/c6841450/attachment.html>


More information about the Freeradius-Users mailing list