Reply to Re: DinkC++: An Intro. Article 1
If you don't have an account, just leave the password field blank.
Update: Math support has been added. These now work:
abs(n)
-- Returns absolute value of n.
sin(n)
-- Returns sine of n.
cos(n)
-- Returns cosine of n.
tan(n)
-- Returns tangent of n.
asin(n)
-- Returns arcsine (sin ^ -1) of n.
acos(n)
-- Returns arccosine (cos ^ -1) of n.
atan(n)
-- Returns arctangent (tan ^ -1) of n.
atan2(y, x)
-- Returns arctangent of y/x. Returns the angle of the bidimensional vector (x, y).
ceil(x)
-- Returns smallest integer greater than or equal to x.
floor(x)
-- Returns the largest integer less than or equal to x.
mod(x, y)
-- Find the modulus between x and y (Remainder of floating-point division).
frexp(x, y)
-- Gets the mantissa and exponent of a floating-point value.
ldexp(x, y)
-- Gets the floating-point value from a mantissa and an exponent
sqrt(x)
-- Finds the square root of x
min(x, ...)
-- Finds the lowest in a series of numbers.
max(x, ...)
-- Finds the greatest in a series of numbers.
log(x)
-- Finds the natural logarithm of x.
log10(x)
-- Finds the common logarithm of x (I love logarithms).
exp(x)
-- Returns the exponential of x (I hate exponentials).
deg(x)
-- Converts x (in radians) to degrees.
pow(x, y)
-- Raises x to the y power. Also works with the ^ symbol.
rad(x)
-- Converts x (in degrees) to radians.
random()
-- Picks a random number.
randomseed(x)
-- Re-randomizes the random seed.
For example:
function main()
....Log(math.pi);
....Log(math.sin(math.pi));
end
Returns to STDIO (The Log function without the math. prefix sends it to the log file):
Windemere inkC++: 3.1415926535898
Windemere inkC++: 1.2246063538224e-16
abs(n)
-- Returns absolute value of n.
sin(n)
-- Returns sine of n.
cos(n)
-- Returns cosine of n.
tan(n)
-- Returns tangent of n.
asin(n)
-- Returns arcsine (sin ^ -1) of n.
acos(n)
-- Returns arccosine (cos ^ -1) of n.
atan(n)
-- Returns arctangent (tan ^ -1) of n.
atan2(y, x)
-- Returns arctangent of y/x. Returns the angle of the bidimensional vector (x, y).
ceil(x)
-- Returns smallest integer greater than or equal to x.
floor(x)
-- Returns the largest integer less than or equal to x.
mod(x, y)
-- Find the modulus between x and y (Remainder of floating-point division).
frexp(x, y)
-- Gets the mantissa and exponent of a floating-point value.
ldexp(x, y)
-- Gets the floating-point value from a mantissa and an exponent
sqrt(x)
-- Finds the square root of x
min(x, ...)
-- Finds the lowest in a series of numbers.
max(x, ...)
-- Finds the greatest in a series of numbers.
log(x)
-- Finds the natural logarithm of x.
log10(x)
-- Finds the common logarithm of x (I love logarithms).
exp(x)
-- Returns the exponential of x (I hate exponentials).
deg(x)
-- Converts x (in radians) to degrees.
pow(x, y)
-- Raises x to the y power. Also works with the ^ symbol.
rad(x)
-- Converts x (in degrees) to radians.
random()
-- Picks a random number.
randomseed(x)
-- Re-randomizes the random seed.
For example:
function main()
....Log(math.pi);
....Log(math.sin(math.pi));
end
Returns to STDIO (The Log function without the math. prefix sends it to the log file):
Windemere inkC++: 3.1415926535898
Windemere inkC++: 1.2246063538224e-16