## Learning to Program with the Cybiko Handheld Computer Using B2C

### Chapter 13 : Math Operations

B2C supports a host of math Operations.  The ordinary operations exist (+, -, *, /,MOD) with which you can do math calculations.  The Order of Operations applies (multiplication and division first, then addition and subtraction) and parentheses are used to change the order of operations. (a=(a+b)*c).

B2C currently supports only integer arithmetic.

```dim a as int
a = 5 + 1
print "the answer is ", a

```

Random Numbers

Random numbers are numbers whose value is unpredictable.  You can get a random number with the Rnd() function:

```Rnd(x)
```

Where 'x' is any number.  Rnd(x) will return a number from 0 to 'x' inclusive.

```x=rnd(5)+1  'return a number from 1 to 6, like a 6-sided die
```

 file: /Techref/cybiko/b2c/ch13.htm, 1KB, , updated: 2008/6/13 16:51, local time: 2024/9/7 10:19, TOP NEW HELP FIND:  98.81.24.230:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?Please DO link to this page! Digg it! / MAKE! cybiko b2c ch13

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
 Did you find what you needed? "No. I'm looking for: " "No. Take me to the search page." "No. Take me to the top so I can drill down by catagory" "No. I'm willing to pay for help, please refer me to a qualified consultant"

 PICList 2024 contributors: o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr.

.