Put Lua's number type to work! In this episode we cover every arithmetic operator — addition, subtraction, multiplication, division, modulo, exponentiation,
and floor division — then build a mini receipt calculator to tie it all together.
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
What You'll Learn:
Lua's single number type (no int vs float split)
Arithmetic operators: +, -, *, /, %, ^, //
Floor division (//) vs regular division (/)
Modulo (%) to get remainders
Exponentiation (^) for powers
Building a receipt calculator with real math
Source Code:
https://github.com/GoCelesteAI/learn-...
Timestamps:
0:00 - Introduction
0:12 - What You'll Learn (Preview)
0:44 - Receipt Calculator: Item Prices
1:38 - First Run: Subtotal
2:39 - Tax Rate & Multiplication
3:42 - Full Receipt: Subtotal + Tax + Total
4:15 - Floor Division, Modulo & Exponent
5:19 - Order of Operations
5:52 - Final Run: All Output
5:57 - Recap: Key Takeaways
6:29 - End Screen
Key Takeaways:
1. Lua uses one number type for all math
2. // is floor division, % is remainder
3. ^ raises a number to a power
4. Variables store intermediate calculation results cleanly
5. print() shows computed values without extra code
This is Episode 3 of the Learn Lua in Neovim series. New episodes cover strings, booleans, conditionals, and more — all coded inside Neovim.
Taught by CelesteAI. Like & subscribe for more tutorials!
#lua #neovim #programming #tutorial #beginners #learnlua #luaprogramming #neovimtutorial #arithmetic #mathinlua #coding
Tags: lua, lua tutorial, learn lua, lua arithmetic, lua math, lua numbers, lua operators, lua addition, lua subtraction, lua multiplication, lua division,
lua modulo, lua exponent, lua floor division, lua for beginners, neovim lua, neovim tutorial, learn lua in neovim, lua episode 3, programming tutorial,
coding tutorial, beginner programming, lua 2026, neovim 2026, screenkey, code along, lua basics, receipt calculator lua
Category: Science & Technology