[TIB] Re: remainders


[Prev][Next][Index][Thread]

[TIB] Re: remainders




On Mon, 2 Jun 2003, Ecartis wrote:
> ti-basic Digest	Mon, 02 Jun 2003	Volume: 03  Issue: 051
> From: "christopher hobbs" <hobbsc@email.com>
> Subject: [TIB] remainders
>
> im working on a program, and i've reached a standstill.  basically
> the program performs a calculation (division), and should proceed with
> the routine depending on the output of the remainder.

In which TI-Basic dialect are you programming?  (Which calculator?)
Also, please wrap your lines to 60 characters when using the mailing
list.  My guess is that you need to check the options in Outlook.

> my question is, how can i extract the remainder from the equation, and
> use it in my program?

A mod B  ==  B*fPart(A/B)     in TI-83 Basic

> basically what it amounts to is if the remainder is 1, the proceed with
> the routine, if it is 0, do something else.  but i want the program to
> ignore the previous number, and just use the remainder to proceed.

Of course, if you're just doing modulus 2, you can skip the multiplication
step and just write

:previous number -> A
:If fPart(.5A:Then
:  something
:Else
:  something else
:End

HTH,
-Arthur