mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 17:15:16 -04:00
added basic probability computation to global routing matrix, and debug output. Fixed bug in Float serialisation (this should be improved btw)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6890 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f3750d0d61
commit
03e6fb8a4a
5 changed files with 217 additions and 22 deletions
|
@ -210,7 +210,7 @@ bool setRawUFloat32(void *data,uint32_t size,uint32_t *offset,float f)
|
|||
// 0.01% and most of the time less than 1e-05% The error is well distributed
|
||||
// over numbers also.
|
||||
//
|
||||
uint32_t n = (uint32_t)( (1.0f/(1.0f+f) * (~(uint32_t)0))) ;
|
||||
uint32_t n = (f < 1e-7)?(~(uint32_t)0): ((uint32_t)( (1.0f/(1.0f+f) * (~(uint32_t)0)))) ;
|
||||
|
||||
return setRawUInt32(data, size, offset, n);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue