- TI nspire
[function] part() // nspire 레퍼런스 가이드북에 없는 함수
1. part()
"Error: Argument must be a Boolean expression or integer"
1.1 part(data) ⇒ (number) index
- data 에서 (계산 우선순위상) 처음 실행되는 function(기능) 이 포함하고 있는 요소(argument) 의 갯수를 반환함.
- data==list,
list 의 element 갯수 - data==matrix,
matrix 열(row) 갯수 - data==expression,
수식에 포함된 기능(연산자(+ - × ÷ ^...) / 함수(cos()...) / "and" / "or" 등등) 중에서, 뭐가 됐든 우선순위가 제일 높은 것에 필요한 요소(argument)의 갯수를 반환함.
1.2 part(data, index)
- index==0 일 때,
data에 포함된 기능을 string 형식으로 반환합니다.
예) "{", "or", "+", "/" - data==list,
list 의 index에 해당하는 요소를 반환 - data==matrix,
matrix index에 해당하는 열(row) 를 list 형식으로 반환 - data==expression,
기능에 사용되는 요소를 순서대로 반환
2. 사용 예시

ㄴ 리스트나, 매트릭스는 이해하기 쉽습니다.

ㄴ 실수나 순허수의 연산자가 없고 자기 자신이 "실수" "순허수"로 기능에 해당합니다. 따라서 요소arguments=0 이 되는 거구요.
ㄴ 순허수가 아닌 복소수는 실수+순허수와 같이 표현되므로 연산자 "+"가 기능에 해당하고, 실수와 순허수가 요소에 해당하여 arguments=2 가 됩니다.
ㄴ 유리수는... 조금 특별한데, 1/2 은 기능이 "1/2"로서 argument=0 이고, √2/2 는 기능이 "/" 이고 arguments=2 입니다.
ㄴ 수식에 연산자가 있더라도 계산에 의해 즉시 단순화되는 경우(1+2+3 = 6) 단순화된 결과를 기준으로 part() 가 실행됩니다.

ㄴ and 와 or 가 나열되어 있는 경우, or 연산자가 우선순위를 갖습니다.
ㄴ or 연산자가 여러개 있을 경우 왼쪽부터 실행됩니다. (and도 동일)
ㄴ or 연산자는 or 를 기준으로 왼쪽과 오른쪽 두개의 요소로 기능이 구현 됩니다. arguments=2 (and도 동일)

댓글7
- 1
- 2
-
3
FireCraft
part처럼 연산자나 함수를 뽑아주는 명령어가 그 cas에 없다면 그게 cas라고 부를 수 있나? 생각됩니다.
전 split( )함수를 구현하면서 (저도 split이란 이름을 붙였습니다) 코드를
split(v1)=func
if part(v1,0)="or"
return augment({part(v1,1)}, {split(part(v2,2))})
return {v1}
end func
이런 방식으로 짰습니다. (이해하기 쉽게 흐름만 보인 것으로 실제 코드는 아닙니다)
솔직히 아랫글 보고 좀 놀란게 part명령어를 일부러 숨겨놓은 것 같은데 part명령어가 없이 기능들을 짤 수 있을까? 생각해 보았습니다 그러면 식을 string으로 잡아서 거기서 찾아내는 방법을 써야되겠다. 와, 근대 그렇게 짜라고? 이런 생각을 했었는데 제가 생각한 방식 그대로 코드가 되어 있어서였습니다 -
세상의모든계산기
[TI-89, 92 plus guidebook] p.477 에 멀쩡하게 나와 있네요.
제가 nspire part() 로만 검색해서 도통 안나왔었나봅니다.
part() CATALOG
part(expression1[,nonNegativeInteger])
This advanced programming function lets you identify and extract all of the subexpressions in the simplified result of expression1.
For example, if expression1 simplifies to cos(π* x+3):
• The cos() function has one argument: (π* x+3).
• The sum of (π* x+3) has two operands: π* x and 3.
• The number 3 has no arguments or operands.
• The product π* x has two operands: p and x.
• The variable x and the symbolic constant p have no arguments or operands.
If x has a numeric value and you press diamond enter, the numeric value of π* x is calculated, the result is added to 3, and then the cosine is calculated.
cos() is the top-level operator because it is applied last.
part(expression1) ⇒ number
Simplifies expression1 and returns the number of top-level arguments or operands. This returns 0 if expression1 is a number, variable, or symbolic constant such as π, e, i, or ∞.

part(expression1, 0) ⇒ string
Simplifies expression1 and returns a string that contains the top-level function name or operator. This returns string(expression1) if expression1 is a number, variable, or symbolic constant such as π, e, i, or ∞.

part(expression1, n) ⇒ expression
Simplifies expression1 and returns the nth argument or operand, where n is > 0 and ≤ the number of top-level arguments or operands returned by part(expression1). Otherwise, an error is returned.

By combining the variations of part(), you can extract all of the sub-expressions in the simplified result of expression1. As shown in the example to the right, you can store an argument or operand and then use part() to extract further sub-expressions.
Note: When using part(), do not rely on any particular order in sums and products.
Expressions such as (x+y+z) and (x-y-z) are represented internally as (x+y)+z and (x-y)-z. This affects the values returned for the first and second argument. There are technical reasons why part(x+y+z,1) returns y+x instead of x+y.
Similarly, x*y*z is represented internally as (x*y)*z. Again, there are technical reasons why the first argument is returned as y•x instead of x•y.
When you extract sub-expressions from a matrix, remember that matrices are stored as lists of lists, as illustrated in the example to the right.

The example Program Editor function to the right uses getType() and part() to partially implement symbolic differentiation. Studying and completing this function can help teach you how to differentiate manually. You could even include functions that the TI-89 / TI-92 Plus cannot differentiate, such as Bessel functions.

- 1
세상의모든계산기 님의 최근 댓글
참고 - [공학용 계산기] 로그의 입력 (log, ln) (feat. 밑 입력이 안되는 계산기는?) https://allcalc.org/14995 2025 11.14 HP-39gII 에 ExistOS 설치하기 https://allcalc.org/38526 2025 11.07 1. 왜 검은색이 아닌 다른 색으로 보일까? (제공된 LUT 필터) 제가 제공해 드린 magenta_lens.cube LUT 필터는 540~560nm(녹색-노란색) 파장대의 색상을 '완전히 제거(검은색으로 만듦)'하는 대신, '다른 색상으로 왜곡/변환'하도록 설계되었습니다. * 원리: LUT(Look-Up Table)는 특정 입력 색상(Input RGB)을 미리 정해진 다른 출력 색상(Output RGB)으로 매핑하는 테이블입니다. 이 LUT는 540~560nm에 해당하는 RGB 값들이 들어오면, 검은색(0, 0, 0)이 아닌, 매우 어둡거나 채도가 낮은 특정 색(예: 어두운 올리브색, 갈색 등)으로 변환하라고 지시합니다. * 의도: * 현실적인 물리 필터 시뮬레이션: 실제 고가의 색약 보정 안경도 특정 파장을 100% 완벽하게 차단하지는 못합니다. 빛의 일부를 흡수하고 일부는 통과시키거나 변환하는데, 이 LUT는 그러한 현실 세계의 필터 효과를 더 비슷하게 흉내 냈을 수 있습니다. * 시각적 정보 유지: 특정 색을 완전히 검게 만들면 그 부분의 형태나 질감 정보가 완전히 사라집니다. 하지만 다른 어두운 색으로 대체하면, 색상 정보는 왜곡되더라도 밝기나 형태 정보는 어느 정도 유지되어 전체적인 이미지가 덜 어색하게 보일 수 있습니다. 결론적으로, 스펙트럼 그림에서 해당 대역의 색이 갑자기 '다른 색으로 툭 바뀌는' 현상은, LUT 필터가 "이 파장대의 색은 앞으로 이 색으로 표시해!"라고 강제적으로 지시한 결과이며, 이것이 바로 이 필터가 작동하는 방식 그 자체입니다. 2. 왜 'Color Vision Helper' 앱은 검은색으로 보일까? 비교하신 'Color Vision Helper' 앱은 노치 필터의 원리를 더 이상적(Ideal)이고 교과서적으로 구현했을 가능성이 높습니다. * 원리: "L-콘과 M-콘의 신호가 겹치는 540~560nm 파장의 빛은 '완전히 차단'되어야 한다"는 개념에 매우 충실한 방식입니다. * 구현: 따라서 해당 파장에 해당하는 색상 정보가 들어오면, 어떠한 타협도 없이 그냥 '검은색(RGB 0, 0, 0)'으로 처리해 버립니다. 이는 "이 파장의 빛은 존재하지 않는 것으로 처리하겠다"는 가장 강력하고 직접적인 표현입니다. 2025 11.06 적용사례 4 - 파장 스펙트럼 https://news.samsungdisplay.com/26683 ㄴ (좌) 연속되는 그라데이션 ➡️ (우) 540 이하 | 구분되는 층(색) | 560 이상 - 겹치는 부분, 즉 540~560 nm 에서 색상이 차단? 변형? 된 것을 확인할 수 있음. 그럼 폰에서 Color Vision Helper 앱으로 보면? ㄴ 540~560 nm 대역이 검은 띠로 표시됨. 완전 차단됨을 의미 2025 11.05 빨간 셀로판지로도 이시하라 테스트 같은 숫자 구분에서는 유사한 효과를 낼 수 있다고 합니다. 색상이 다양하다면 빨강이나, 노랑, 주황 등도 테스트해보면 재밌겠네요. 2025 11.05