Closed cosmoharrigan closed 6 years ago
As implemented, the values stored there are good only to about 24 bits, and the rest is all round-off error.
You can try changing everything to double, I don't care. The use of float is historical, and had something to do with running out of RAM.
well .. less than 24 bits. a 32-bit float uses a 22-bit mantissa and an 8-bit exponent, and two sign bits. The confidenceToCount etc functions are written so that if you use them over and over, precision decays to about 12 bits accuracy pretty quick.
closing, stale bug report
The maximum value that
SimpleTruthValue::confidenceToCount
will return is 4473923584: https://github.com/opencog/opencog/blob/master/opencog/atomspace/SimpleTruthValue.cc#L110but
SimpleTruthValue
storescount
as a double: https://github.com/opencog/opencog/blob/master/opencog/atomspace/SimpleTruthValue.h#L50 https://github.com/opencog/opencog/blob/186f25f8731e6fd912ceb915057d83997c3d3c8e/opencog/atomspace/TruthValue.h#L53 which can have a very large value.this seems confusing, because if you tried to convert back and forth between them, you would lose information; for example, if the count were very large, and you used countToConfidence and then confidenceToCount, the number would reduce dramatically.
How should this actually be implemented?