I got a problem with function bson_append_double below:
dvalue = 0.01;
bson_append_double(pbson, field_name, -1,(double)dvalue);
but the result i got is annoying long: 0.0099999997764825820923 Did anyone faced this problem before, please help me. Thanks and Regards
this is simply a float-to-double conversion. If you don't want to lose the precision, you'll need to declare the variable as a double in the first place.
somewhere in your code you have a line
if you are able to promote to type double you should consider changing the declaration to:
here is a previous question on loss of precision in conversions.
Precision loss from float to double, and from double to float?