Bitcoin Block Reward value How can someone calculate the current/real-time value of a Bitcoin block?

What is the equation/algorithm used to determine this?

I've found a few resource online, but I'm a little confused
How can someone calculate the current/real-time value of a Bitcoin
  block?


Steps:


run bitcoin-cli getblockcount to get current block_height
current_block_reward = 50 / [(block_height MOD 210000) + 1]



  What is the equation/algorithm used to determine this?


Value the of a Bitcoin block defined here. The default value is 50 * 100,000,000 Satoshis. 

After every "SubsidyHalvingInterval" blocks, the reward of each block halved. The SubsidyHalvingInterval is defined here

CAmount GetBlockValue(int nHeight, const CAmount&amp; nFees)
{
    CAmount nSubsidy = 50 * COIN;
    int halvings = nHeight / Params().SubsidyHalvingInterval();

    // Force block reward to zero when right shift is undefined.
    if (halvings &gt;= 64)
        return nFees;

    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy &gt;&gt;= halvings;

    return nSubsidy + nFees;
}