■ Decimal 클래스의 is_signed 메소드를 사용해 음수 여부를 구하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import decimal decimal1 = decimal.Decimal("+5") decimal2 = decimal.Decimal("-10") print(decimal1.is_signed()) print(decimal2.is_signed()) """ False True """ |