## UBasic Modulo Function Update

## UBasic Modulo Function Update

(OP)

With regards to thread204-1706016: UBasic Modulo Function

Found a site that may help -- even though it's a 2-year old post, this may be of use for the next person. It mentions cameras towards the later half of the wiki.

http://chdk.wikia.com/wiki/UBASIC/TutorialScratchp...

Once there, search for the section entitled (now get this...)

It is approximately 1/4 of the way down from the top (currently). I'd recommend you use your browser's

Then carefully read the first 2 paragraphs.

AND Before anyone gets mad; there is no uBASIC on this site. Not like it's still active nor popular, BUT I've checked and we have:

--MiggyD

## Quote (JHHPavel)

I was writing a program in UBasic, ... and couldn't remember the proper format for the modulo function.

I tried googling for help but ... I couldn't find a math function help screen.

Does anyone know the proper format? Or have a link to a UBasic help site that doesn't deal with focusing cameras?

Found a site that may help -- even though it's a 2-year old post, this may be of use for the next person. It mentions cameras towards the later half of the wiki.

http://chdk.wikia.com/wiki/UBASIC/TutorialScratchp...

Once there, search for the section entitled (now get this...)

**Math Expressions allowed in uBASIC**It is approximately 1/4 of the way down from the top (currently). I'd recommend you use your browser's

__function for the above (or at least 'Math Expressions').__*"FIND"*Then carefully read the first 2 paragraphs.

AND Before anyone gets mad; there is no uBASIC on this site. Not like it's still active nor popular, BUT I've checked and we have:

- DarkBASIC
- Visual BASIC
- Visual BASIC for Applications (VBA)
- QBasic
- Even, Vb Script

**choice forum to post that question. And (at least for me) warranted some help.***only*--MiggyD

## RE: UBasic Modulo Function Update

In short MODULO (in UBasic) simply means "REMAINDER" -- and -- the mathematical expression to activate it is by using the percent sign (

%).So based on that info, if someone gave you (US) 459 pennies you could use modulo to tell you that a customer gave you 4 dollars and 59 cents with:

print " whole dollars:", 459/100

print "additional cents:", 459

%100In this example, 1 U.S. dollar (the WHOLE unit) is made up of 100 pennies.

In the wiki example, 1 minute (the WHOLE unit) is made up of 60 seconds.

Modulo may be appropriate in certain calculations. One would just need to know the Whole Unit and it's constituents.

HTH

--MiggyD

After pondering the riddle (for many years I might add) I finally got the answer (inadvertently through a movie): "If a tree falls in the forest and no one is around, does it make a sound?"