Practising Lua - the Euler problems

At least 100! is right :wink: Your solution was very clever, working digt by digit. Cool.

I’ve made it more obfuscated (with extra functions) because I want to have in my own math library routines for basic operations with big numbers converted into strings. ~O)

@quezadav My first program above worked digit by digit, which made it slow. The second program works 14 digits at a time, making it much faster. The first program did 20,000! in 257 seconds, the second program in 11 seconds.

^:)^

Yes, the fastest approach to integer arithmetic seems to be to break the numbers into chunks, each with half the maximum number of digits that can be multiplied together accurately in floating points. Then cross multiply all the pieces.