You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
a two functions
function eplus(n1,n2)
-- works how e+
end
function eminus(n1,n2)
-- works how e-
end
print(eplus(1,2)) -- prints 10
print(eminus(1,2)) -- prints 0.1
What is the issue? Include screenshots / videos if possible!
no idea to make it
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
this not breaks the rules for only are two functions not a system complete or a complete script i’m making the script for my account i’m only need thats functions
There is a very simple way of doing this: In basic terms the number of the left of the e is the coefficient and the number on the right of the e is the exponent. The e is a replacement for ‘10 to the power of’
lua has very good features for exponents so we can just do this as:
local function calculate_e(n1, n2)
return n1 * 10^n2
end
This is incorrect. Scientific notation of the form:
AeB = A + 10^B
So technically, 1e(1/2) would be the square root of 10 = 3.1666
But that defeats the purpose of scientific notation. B is always an integer so that you are always looking at the significant digits (in this case “1”).