mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* implemented modulus operator % and %= for doubles int%dbl=dbl dbl%int=dbl dbl%dbl=dbl ... * added missing test for ins_set_member_id_consume_divideequal * more tests docs
57 lines
1.3 KiB
Text
57 lines
1.3 KiB
Text
// do crazy senseless stuff
|
|
// nothing should crash
|
|
program foo()
|
|
var a;
|
|
var test := { a, struct, dictionary, array, "", 4, 1.5 };
|
|
|
|
foreach t1 in test
|
|
foreach t2 in test
|
|
print( $"'{t1}' vs '{t2}'" );
|
|
print( $"!t1 {!t1}" );
|
|
print( $"~t1 {~t1}" );
|
|
print( $"-t1 {-t1}" );
|
|
print( $"+t1 {+t1}" );
|
|
print( $"t1*t2 {t1 * t2}" );
|
|
print( $"t1/t2 {t1 / t2}" );
|
|
print( $"t1+t2 {t1 + t2}" );
|
|
print( $"t1-t2 {t1 - t2}" );
|
|
print( $"t1%t2 {t1 % t2}" );
|
|
print( $"t1&t2 {t1 & t2}" );
|
|
print( $"t1^t2 {t1 ^ t2}" );
|
|
print( $"t1|t2 {t1 | t2}" );
|
|
print( $"t1>>t2 {t1 >> t2}" );
|
|
print( $"t1<<t2 {t1 << t2}" );
|
|
PlusEqual( t1, t2 );
|
|
MinusEqual( t1, t2 );
|
|
TimesEqual( t1, t2 );
|
|
DivEqual( t1, t2 );
|
|
ModulusEqual( t1, t2 );
|
|
endforeach
|
|
endforeach
|
|
endprogram
|
|
|
|
function PlusEqual( t1, t2 )
|
|
var t := t1;
|
|
t += t2;
|
|
print( $"t1+=t2 {t}" );
|
|
endfunction
|
|
function MinusEqual( t1, t2 )
|
|
var t := t1;
|
|
t -= t2;
|
|
print( $"t1-=t2 {t}" );
|
|
endfunction
|
|
function TimesEqual( t1, t2 )
|
|
var t := t1;
|
|
t *= t2;
|
|
print( $"t1*=t2 {t}" );
|
|
endfunction
|
|
function DivEqual( t1, t2 )
|
|
var t := t1;
|
|
t /= t2;
|
|
print( $"t1/=t2 {t}" );
|
|
endfunction
|
|
function ModulusEqual( t1, t2 )
|
|
var t := t1;
|
|
t %= t2;
|
|
print( $"t1%=t2 {t}" );
|
|
endfunction
|