I wanted to know how to use modulation ? in most of programming languages its MOD or % but doesn't work in ZGE...
10 mod 5 = 0
10 % 5 = 0
12 % 5 = 2
i need it now
Syntax question?
Moderator: Moderators
Syntax question?
Yo mama's so fat that a recursive function computing her weight causes a stack overflow.
You can use frac-funtion which returns the decimal part.
frac(10.5) = 0.5
frac(10) = 0.0
Temp1=12/5; //2.4
Temp2=Temp1-frac(Temp1); //2.0
Temp1=Temp1*5 - Temp2*5; //2.0
Temp1 now has the mod-value.
Maybe if you tell me what you want to do then I can suggest an
easier variant?
I will add a mod-function in a later version.
frac(10.5) = 0.5
frac(10) = 0.0
Temp1=12/5; //2.4
Temp2=Temp1-frac(Temp1); //2.0
Temp1=Temp1*5 - Temp2*5; //2.0
Temp1 now has the mod-value.
Maybe if you tell me what you want to do then I can suggest an
easier variant?
I will add a mod-function in a later version.
Re: Syntax question?
I'm not totally up to date with the syntax in ZGE but couldn't you do?turshija wrote:I wanted to know how to use modulation ? in most of programming languages its MOD or % but doesn't work in ZGE...
10 mod 5 = 0
10 % 5 = 0
12 % 5 = 2
i need it now
modvalue =frac(X/Y)*Y
Where from your example x=10 and y=5
Re: Syntax question?
Ah, clever!beldus wrote: modvalue =frac(X/Y)*Y
Where from your example x=10 and y=5
I knew there must be a simpler solution then what I suggested.
Re: Syntax question?
nice ...beldus wrote: modvalue =frac(X/Y)*Y
Where from your example x=10 and y=5
I'm happy there are more people online because there are more ideas
Thanks ...
Yo mama's so fat that a recursive function computing her weight causes a stack overflow.