` ``#include <iostream> using namespace std; int mul_inv(int a, int b) { int b0 = b, t, q; int x0 = 0, x1 = 1; if (b == 1) return 1; while (a > 1) { q = a / b; t = b, b = a % b, a = t; t = x0, x0 = x1 - q * x0, x1 = t; } if (x1 < 0) x1 += b0; return x1; } int main(void) { cout<<mul_inv(42, 2017)<<endl; return 0; }`

in my TI-Nspire CX So far I have the following code but am getting variable not defined in if statement.

Here is the code I have in my Nspire CX so far.

` ``Define LibPub modinv(a,b)= Func Local b0,t,q,x0,x1 0→x0 1→x1 If b=1 Then Return 1 EndIf While a>1 q:=((a)/(b)) t:=b b:=mod(a,b) a:=t t:=x0 x0:=x1-q*x0 x1:=t EndWhile If x1<0 Then x1:=x1+b0 EndIf Return x1 EndFunc`

the inspire is throwing an error on this line.

` `` If x1<0 Then x1:=x1+b0 EndIf`

Not sure what I am doing wrong here! Any insight would be appreciated!

]]>` ``Define chat()= Prgm Requeststr “Say Something:”,I,0 If I=“test” Then Disp “You: “,I Wait 1 Disp “Java: Test is valid” Wait 3 Requeststr “Say something:”,I,0 Elseif I=“r” then Disp “You: “,I Wait 1 Disp “Java: Test is valid” Endif Endprgm`

How do I make any phrase/word be able to be said on any “say something”? Because I just says say something I type r and it says say something again and then I say r and it works. I want to not make it an orderly fashion and make it work every time… please help me… ]]>

` ``Disp “score=“,score”%”`

So the output is:

` ``Score=80%`

Define whatsmyname()

Prgm

Disp “you’re “,name

RequestStr “would you like a name change?”,n

If yes Then

RequestStr “New name:”,name,0

Else

Text “ok, fair enough.”,0

Don’t judge me please. I’m new to programming and This is my first program.

]]>a few days ago I have a fantastic TI nspire CX II CAS, historically I have always used HP (48SX, 50G and now Prime), but I love this TI and the Student program of program processing etc ..

I am delighting myself but I am unable to develop the result of a formula containing trigonometric functions. I tried to prepend commands such as Solve, Expand ..

Nothing to do, in the result of the calculation, the program does not develop the SIN and COS calculation.

Angle format in degrees, CAS enabled ….

How can I go about developing the calculation?

the list of the program is this one:

**h:=cos(20)

Disp "result",h**

the result is "cos(20) not the result….

thanks

]]>For a simple example, take the second ODE (1)

\begin{align} y''+5y'+7y=0 ~ \wedge ~ y(0)=5 ~ \wedge ~ y'(0)=7 \end{align}

(2) \begin{align} \implies y_c=c_1e^{4t}+c_2e^{8t} \end{align}

Once I solve the system yielded by the initial conditions for $c_1 \wedge c_2$, I can only get the output as conjunction.

Please see the images below on flickr

/photos/186829666@N04/49497274396/in/dateposted-public/

/photos/186829666@N04/49496869313/in/dateposted-public/

To no avail, I have tried indexing {[1]} the result and converting the expression into a list and then indexing {exp▶list(…,.)[1]}.

p.s. **I'm aware of the deSolve() function**, but this is a matter that is troubling beyond the domain of DEs…plus, it's bugging me.

Func

Local

solve(q=(0.5+((q^(2))/((h+p)^(2)*l^(2)*2*g)))^(((3)/(2)))*c*((2)/(3))*√(((2)/(3))*g)*l,q)

Return q

EndFunc

the error I get when running it is “Too many arguments” but I’m inputting 5 numbers separated by comas, in their respective slot

imgurdotcom/a/YyuGanC

]]>So for say 7^-1 mod 192

It needs to be simple code i can just type into the ti nspire program's by hand. ]]>