Jump to content



Photo
- - - - -

Mod in Casio Basic

modulus mod syntax error syntax error

Best Answer (*) , 10 August 2017 - 01:49 PM

Change it to

If Frac (2÷2)=0
Then
"HI"
IfEnd
Go to the full post


  • Please log in to reply
3 replies to this topic

#1 hoobigii

hoobigii

    Newbie

  • Members
  • Pip
  • 5 posts
  • Gender:Not Telling

Posted 10 August 2017 - 12:21 PM

Is there a mod operator in Casio Basic?

 

I tried using "Frac (x÷y)", but that doesn't work with an "if" statement.

 

When I do this, I get a syntax error after the "0"

If Frac (2÷2)=0
"HI"
IfEnd

I tried it with a "while" loop and that worked. Is there another one to be used in an "if" statement?

 

EDIT: Also tried the "Mod (2÷2)=0", but I get a memory error that way.


Edited by hoobigii, 10 August 2017 - 12:33 PM.


#2 (*)

(*)

    Casio Addict

  • Members
  • PipPipPip
  • 51 posts
  • Gender:Not Telling

Posted 10 August 2017 - 01:49 PM   Best Answer

Change it to

If Frac (2÷2)=0
Then
"HI"
IfEnd


#3 hoobigii

hoobigii

    Newbie

  • Members
  • Pip
  • 5 posts
  • Gender:Not Telling

Posted 10 August 2017 - 02:09 PM

 

Change it to

If Frac (2÷2)=0
Then
"HI"
IfEnd

I'm such an idiot.  :banghead:

Why did I not notice that!

Thanks



#4 HappyCalc

HappyCalc

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2
    fx-CG50

Posted 19 February 2022 - 08:05 AM

There is also a Mod Operator, but you have to do it like this:
Mod(A,B )
If Mod(2,2)=0
Then
"HI"
IfEnd

Edited by HappyCalc, 19 February 2022 - 08:06 AM.

  • HappyCalc likes this





Also tagged with one or more of these keywords: modulus, mod, syntax error, syntax, error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users