To add to the Cubescript math functions, here is a script that rounds a number. Use (roundf 5.5234234), just like an operator; rounds to the nearest integer.
One question: GD always told me to use concat, but I see some scripts that use this syntax.
Which is comparable to
The latter is perfectly fine but what about Cubescript?
Goes well with V-Man's exponent script (posted already, somewhere).
[SELECT ALL] Code:
roundf = [
if (>= (+f ($arg1) 0.5) (+ ($arg1) 1.0)) [
(+ ($arg1) 1)] [
(+ ($arg1) 0)]
]
[SELECT ALL] Code:
echo $onething $secondthing "a string here" "and another string here"
[SELECT ALL] Code:
cout << onething << anotherthing << "string here";
Goes well with V-Man's exponent script (posted already, somewhere).
[SELECT ALL] Code:
//Exponent script "exp 5 2" = 5^2
alias powerloop [
(alias product (*f $base $product));
(alias power (+f $power 1));
(if (<f $power $pow) [powerloop] [result $product])]
alias exp [
(alias product 1);
(alias power 0);
(alias base $arg1);
(alias pow $arg2);
(powerloop base pow)]