Divide with uint256

I woulld like to use this code:

It is not work:

uint256 vTeamDiv= _devFee/2; // it is for example 4
_rOwned[_devWalletAddress] = _rOwned[_devWalletAddress].add(rDev-(rDev/vTeamDiv)

But this works:
_rOwned[_devWalletAddress] = _rOwned[_devWalletAddress].add(rDev-(rDev/4));

what is the problem?

1 Like

Missing ); at the end, for one.

Thx but it is only copy misstake :)I can solve this mathematical problem with safeMath.

1 Like

What do you mean it doesn't work? What error are you seeing? You need to share more details.

If I divide by uint256 type I can get not good result or zero result, But if I divide normaly number directly it give good result..Why? Need I divide not by uint 256? Wich variable type will good for divide?