Help with e+ and e-

You can write your topic however you want, but you need to answer these questions:

  1. 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
  1. What is the issue? Include screenshots / videos if possible!

no idea to make it

  1. 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

You want to achieve “a two functions”

I’m sorry you are going to need to be more clear. Can’t help

function eplus(n1,n2)
-- works how e+
end

function eminus(n1,n2)
-- works how e-
end

that are the functions

it’s not so hard and if you not go to help better no comment

What is an “e+” and an “e-”. Please elaborate. I did a google search for “e+” and “e-” and nothing meaningful came up.

by e+ and e- do you mean exponents?

yes.

the e+ it’s how + or -

1e+2 = 10
1e-2 = 0.1

but the script i’m using works width arguments and when you try argument1 e+ argument2 not works

yes. i’m not know good the name

Is this what you are talking about?
e (mathematical constant) - Wikipedia.

no is not euler it’s a exponent and the euler is a variable

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
2 Likes

thanks now i can make the calculator

2 Likes

Just a math correction, so you don’t get things twisted later. This is “scientific notation”

1e2 = 100
1e1 = 10
1e0 = 1
1e-1 = 0.1

More references:
Convert 1e2 to decimal | Scientific Notation to Decimal Calculator (coolconversion.com)

1 Like

Not to cause any additional confusion but.

1^(1/2) = 1
1^(-1/2) = 1

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”).

1 Like

For some reason I thought this was a powers thread. So 1^n not 1en.

1 Like