AP_Math: Change mask value to hexadecimal number.

This commit is contained in:
murata 2017-01-01 15:28:53 +09:00 committed by Lucas De Marchi
parent 8b38ce666d
commit e903cb9945

View File

@ -190,8 +190,8 @@ uint16_t get_random16(void)
{
static uint32_t m_z = 1234;
static uint32_t m_w = 76542;
m_z = 36969 * (m_z & 65535) + (m_z >> 16);
m_w = 18000 * (m_w & 65535) + (m_w >> 16);
m_z = 36969 * (m_z & 0xFFFFu) + (m_z >> 16);
m_w = 18000 * (m_w & 0xFFFFu) + (m_w >> 16);
return ((m_z << 16) + m_w) & 0xFFFF;
}