안녕하세요, 처음 질문을 올려보내요..
첨부 파일은 제가 쓰고있는 사칙연산 리습입니다.
더하기, 곱하기는 소수점 둘째자리까지 나오는데
빼기와 나누기는 소수점이 없습니다…
고수님들의 답변 부탁드립니다. 감사합니다!
(전체중 일부,, 문제라고 생각되는 부분..)
);repeat
;————————–output
(if (or(= cal “A”) (= cal “D”))
(progn
(princ “ninsertion text point”)
(command “text” “\” “” (rtos ot1 2 2))
(princ (strcat “n계산결과<” tx “>: ” (rtos ot1) ” (” (rtos i) “개 합)”))
)
(princ)
)
(if (= cal “B”)
(progn
(if (< ot1 0)
(setq ot1 (substr (rtos ot1) 2))
(setq ot1 (strcat “-” (rtos ot1)))
)
(princ “ninsertion text point”)
(command “text” “\” “” ot1)
(princ (strcat “n계산결과<” tx “>: ” ot1))
)
(princ)
)
(if (= cal “C”)
(progn
(setq ot1 (/ 1.0 ot1))
(princ “ninsertion text point”)
(command “text” “\” “” (rtos ot1))
(princ (strcat “n계산결과<” tx “>: ” (rtos ot1)))
)
(princ)