-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f8e1a4
commit 2ce44da
Showing
6 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
dict | ||
path | ||
math | ||
list | ||
descriptor | ||
random | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. py:module:: ufp.math | ||
.. py:currentmodule:: ufp.math | ||
:py:mod:`math` 모듈 | ||
========================== | ||
|
||
.. automodule:: ufp.math | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
#-*- coding: utf-8 -*- | ||
|
||
from __future__ import unicode_literals, absolute_import, division, print_function | ||
|
||
def urshift(val, n): | ||
""" | ||
부호 없이 식을 비트 단위로 오른쪽으로 이동합니다. | ||
자바스크립트의 >>> 연산자와 같은 역할을 합니다. 예를 들어 '(-1000) >>> 3'는 'ufp.math.rshift(-1000, 3)'와 같습니다. | ||
.. 참조 : http://stackoverflow.com/questions/5832982/how-to-get-the-logical-right-binary-shift-in-python | ||
:param val: 식 | ||
:param n: 비트 수 | ||
:return: 부호 없이 식을 비트 단위로 오른쪽으로 이동한 결과 값. | ||
""" | ||
if val >= 0: | ||
return val >> n | ||
else: | ||
return ( val + 0x100000000 ) >> n | ||
pass |