modular arithmatic in pipmak

View: New views
2 Messages — Rating Filter:   Alert me  

modular arithmatic in pipmak

by chikitin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I was reading the lua's online manual. i was looking for the mod function ( as % in C++)  I found these:

math.fmod (x, y) and also
bit.mod(a,b) - returns the integer remainder of a divided by b

http://www.wowwiki.com/Lua_functions

but niether of them work in pipmak. Is there a mod function in pipmak?

thanks in advance!

cs

Re: modular arithmatic in pipmak

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I was reading the lua's online manual. i was looking for the mod  
> function (
> as % in C++)  I found these:
>
> math.fmod (x, y) and also
> bit.mod(a,b) - returns the integer remainder of a divided by b
>
> but niether of them work in pipmak. Is there a mod function in pipmak?

Yes, there is math.mod(a, b):

http://www.lua.org/manual/5.0/manual.html#5.5

math.fmod() is new in Lua 5.1, which Pipmak doesn't use yet. bit.mod()  
is not part of the standard libraries that come with Lua and are  
included in Pipmak.

> http://www.wowwiki.com/Lua_functions


As that page says, "a few functions differ slightly in Blizzard's  
implementation", so in general you're better served by the Lua 5.0  
manual (link above) for the standard functions and the Pipmak manual  
for what Pipmak adds to them, than by documentation about World of  
Warcraft or other applications that use (possibly modified versions  
of) Lua.

  -Christian

------------------------------------------------------------------------------
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users