From c079d69291ae5afd5a18985e221b62e8c237eda0 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 5 Feb 2020 23:00:48 +0800 Subject: [PATCH] Added the description for 'div' operator to notes.txt --- artifacts/scripting/sfall function notes.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index 34d83043..23ea88fa 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -281,10 +281,15 @@ Some utility/math functions are available: > int charcode(string string) - returns ASCII code for the first character in given string +> div operator (unsigned integer division) +- use as a division operator, like 3 + (20 div 5) +- if both dividend and divisor are integers, they will be treated as unsigned integers +- if one of them is a float, div will perform the signed division just like vanilla division operator + > ^ operator (exponentiation) - use as any other arithmetic operator, like 5^(1/3) -- if exponent is integer, you can use negative base, otherwise you will get "nan" with negative base -- if both arguments are integers, result will be integer +- if exponent is an integer, you can use a negative base, otherwise you will get "NaN" with a negative base +- if both arguments are integers, the result will be an integer > float log(float x) - natural logarithm of x