Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func layerNum(_layerValue : int) -> int:
- var _layerNum : int
- var LV_expBase2 : int = 0
- while _layerValue != 2:
- var opResidue = _layerValue % 2
- assert(opResidue == 0, "Layer Number Invalid")
- @warning_ignore("integer_division")
- _layerValue = _layerValue / 2
- LV_expBase2 += 1
- _layerNum = 2 + LV_expBase2
- return _layerNum
- func layerValue(_layerNum : int) -> int:
- var _layerValue : int
- _layerValue = 2 ** ( _layerNum - 1 )
- return _layerValue
Advertisement
Add Comment
Please, Sign In to add comment