You are viewing a single comment's thread from:

RE: Why is median_history_price no longer the median of feed price? My investigation.

in #witness-category6 years ago

brilliant, I was looking for a great explanation of this. Resteeming.

On your last point however I am left baffled. unless there is the use if int or round somewhere in the code????

Sort:  

Thank you for resteemd.

You are right, the code of percent_sbd:

auto percent_sbd = uint16_t( ( ( fc::uint128_t( ( dgp.current_sbd_supply * get_feed_history().current_median_history ).amount.value ) * STEEM_100_PERCENT ) / dgp.virtual_supply.amount.value ).to_uint64() );

So although percent_sbd is actually 999.99, but it return 999, and sbd_print_rate return 100(1%) instead of 0.26(0.0026%).

Cool, Great find. Code scares me, there is no way I would have been able to read the code to find that, but math is my thing :-)

Coin Marketplace

STEEM 0.25
TRX 0.21
JST 0.036
BTC 98122.26
ETH 3384.17
USDT 1.00
SBD 3.38