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
16 lines
348 B
Text
16 lines
348 B
Text
program modulus()
|
|
var test := { 0, 1, 0.0, 1.0, 0.1, -1, -1.0 };
|
|
foreach t1 in test
|
|
foreach t2 in test
|
|
print( $"'{t1}' vs '{t2}'" );
|
|
print( $"t1%t2 {t1 % t2}" );
|
|
ModulusEqual( t1, t2 );
|
|
endforeach
|
|
endforeach
|
|
endprogram
|
|
|
|
function ModulusEqual( t1, t2 )
|
|
var t := t1;
|
|
t %= t2;
|
|
print( $"t1%=t2 {t}" );
|
|
endfunction
|