Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Lua module U102
Numbers and the Math library.
Exercises, examples and other material relating to training module U102. This topic is presented on public courses Learning to program in Lua, Lua Programming, Lua Programming

Articles and tips on this subjectupdated
4569Lua - changes to how integers and floats are handled - 5.2 to 5.3
Lua has historically worked internally with floats (actually doubles) even when given whole numbers. The logic was a good one - to keep the language small with a limited number of data types, and for the latest generation of hardware the speed of operations on floating points and doubles really wasn't ...
3917BODMAS - the order a computer evaluates arithmetic expressions
What order does a computer program use to evaluate expressions? If I write   2 + 3 * 4 + 5 does it start off, left to right ...   2 + 3 is 5   5 * 4 is 20   20 + 5 is 25 No! it does not, even though the newcomer might think that was the most natural way for ...
2509A life lesson from the accuracy of numbers in Excel and Lua
Floating point numbers aren't held EXACTLY in a computer's memory - they're held to a certain accuracy (number of significant figures or binary digits to be more accurante) after which they are truncated or rounded. And this means that at time 1.0 / 3.0 * 3.0 doesn't go full circle and come back to ...
2345Automatically initialising Lua variables the first time
In Lua, you need to initialise variables before you perform arithmetic on them, but you CAN test them (and if they don't exist, they will return false). For example, this code initialises a variable to 0 if it doesn't exist, or takes its current value, then adds 1 to it straight away before saving it ...
1744Lua examples, Lua Courses
Programming training is much more effective if the delegates are shown how a particular program is written, rather than just the final result ... show them just the final result and they'll ask "but how did you come up with that?" So whenever possible, I write new examples in front of my delegates - ...
1699If you are learning Lua, here are some more examples
During some courses, I write few (if any) new examples in front of my delegates, rather relying on the standard ones in the training notes (which I wrote anyway!) and making small changes and adjustments to illustrate how things work. On other courses, though, I write a some new examples from scratch ...
Examples from our training material
allfloat   All Lua numbers are floats
ccinit   Initialising Variables
furry   Lua basics - calculations, output and comments
ichange   Lua - integer changes 5.2 to 5.3
larith   Simple string format example
ludo   Comments in Lua
prncr   io.write allows output with no new line
rnum   Reading from the keyboard, calculate and output
vars.lua   Lua Comments and Variables
vatty   Take the VAT back off a gross amount
vn  Variable naming in Lua
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Variables and variable conventions.
Expressions. Operators. Rounding.
Data Types.
Type and Conversion Functions.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Ruby, Lua, Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/U102.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb