Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.


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
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 ...
2012-11-10
 
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 ...
2009-11-21
 
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 ...
2009-08-12
(short)
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 - ...
2008-08-09
 
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 ...
2008-08-05
 
Examples from our training material
allfloat   All Lua numbers are floats
ccinit   Initialising Variables
furry   Lua basics - calculations, output and comments
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 http://www.training-notes.co.uk.
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 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. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

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

PAGE: http://www.wellho.net/resources/U102.html • PAGE BUILT: Thu Sep 18 11:03:17 2014 • BUILD SYSTEM: WomanWithCat