boolean-to-signed-1.0.1


توضیحات

Returns -1 if input is false, or 1 if input is true.
ویژگی مقدار
سیستم عامل -
نام فایل boolean-to-signed-1.0.1
نام boolean-to-signed
نسخه کتابخانه 1.0.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Najim Islam
ایمیل نویسنده -
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/boolean-to-signed/
مجوز -
# boolean_to_signed Returns -1 if input is false, or 1 if input is true. ## Install ```sh $ pip install boolean_to_signed ``` ## Usage ```py from boolean_to_signed import to_signed print(to_signed(False)); #=> -1 print(to_signed(True)); #=> 1 # use cases x = y = value = 0 # using naive conditional assignment if x > 0: y += value else: y -= value; # using direct assignment y += to_signed(x > 0) * value; ``` ## About ### Author **Najim Islam** * [LinkedIn Profile](https://www.linkedin.com/in/najim-i/) ### License Copyright © 2021, [Najim Islam](https://www.linkedin.com/in/najim-i/). Released under the [MIT License](https://opensource.org/licenses/MIT).


نحوه نصب


نصب پکیج whl boolean-to-signed-1.0.1:

    pip install boolean-to-signed-1.0.1.whl


نصب پکیج tar.gz boolean-to-signed-1.0.1:

    pip install boolean-to-signed-1.0.1.tar.gz