[fpc-pascal] C# translatation

Ryan Joseph ryan at thealchemistguild.com
Sun Jan 8 12:55:27 CET 2017


> On Jan 8, 2017, at 5:46 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> 
>> 2) % is the mod operator in pascal right? So what is the modular assignment %=? num = num mod repeat?
>> 
>> p[x] = permutation[x%256];
>> 
>> if (repeat > 0) num %= repeat;
> 
> Correct for both.


why am I getting this error? Operator is not overloaded: "Double" mod “LongInt”. Mod can’t be used with double and integers like in C?

repeatValue: integer;
x, y, z: double;

	if (repeatValue > 0) then			
		begin
			x := x mod repeatValue;
			y := y mod repeatValue;
			z := z mod repeatValue;
		end;



Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list