Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
|
|
@ -0,0 +1,22 @@
|
|||
require "io2"
|
||||
local fmt = require "fmt"
|
||||
|
||||
local f = |x| -> math.sqrt(math.abs(x)) + 5 * x * x * x
|
||||
|
||||
local s = {}
|
||||
print("Please enter 11 numbers:")
|
||||
local count = 0
|
||||
repeat
|
||||
s[++count] = io.readNum(string.format(" Number %-2d : ", count))
|
||||
until count == 11
|
||||
|
||||
s:reverse()
|
||||
print("\nResults:")
|
||||
for s as item do
|
||||
local fi = f(item)
|
||||
if fi <= 400 then
|
||||
fmt.print(" f(%6.3f) = %7.3f", item, fi)
|
||||
else
|
||||
fmt.print(" f(%6.3f) = overflow", item)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue