© Pradeeka Seneviratne  2019
Pradeeka SeneviratneBBC micro:bit Recipeshttps://doi.org/10.1007/978-1-4842-4913-0_8

8. Using Mathematical Functions

Pradeeka Seneviratne1 
(1)
Udumulla, Mulleriyawa, Sri Lanka
 

This chapter presents how to use the built-in mathematical functions to add, subtract, multiply, or divide numeric values; create pseudorandom numbers; find the absolute values of numbers; calculate the remainders; find max and min values; and convert ASCII characters to text.

8-1. Using Basic Mathematical Operations

Problem

You want to use basic mathematical operations such as addition, subtraction, multiplication, and quotient division with two numbers.

Solution

  • In the Toolbox, click on the Variables category and then click on the Make a Variable… ...

Get BBC micro:bit Recipes: Learn Programming with Microsoft MakeCode Blocks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.