|
| 30 Apr 2016 09:25 AM |
I need feedback on this: https://www.roblox.com/Extra-Math-v1-17-item?id=358525642
I've been working on it for a while now, and I need somebody from the outside world to tell me how I'm doing. (basically a "check out my mikstaip mang" request)
It has a bunch of statistical functions, number sequence stuff, totient functions, geometric functions, prime-number functions, root functions, and then some. I'm also gonna be (maybe) adding complex numbers sooner or later. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 09:29 AM |
| Basically a bunch of math functions for people who hate math, made by a dude who loves math more than people. |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 30 Apr 2016 09:38 AM |
Looking at your code, I notice your organization and light use of OOP terms. You're clearly versed in other coding, or have experience in programming concepts for years.
It's not worth judging your functions, as they're quite firm in accuracy. However, I did notice one thing. Your deepCopy() function clones a table, and apparently its metatable. You say it "copies over," but it, in fact, references the original metatable.
/source/5.1/lapi.c.html#lua_getmetatable
^^ Lua's website
Shows that only a pointer is passed. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 09:44 AM |
@nox7 Thanks for the feedback!
I'll probably deep-copy the metatable as well, then set it. I'm not gonna do it right now, though. Replaced all of the old for-loops to have 'for i in pairs()' rather than 'for i = 1, #data' |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:01 AM |
| its amazing, im a veryy new person to programming and it looks like the work of god in my eyes, too bad I dont understand anything.... |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:09 AM |
| Heh, apologies for the lack of documentation. I'll try and add more sooner or later |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 10:11 AM |
@nox
I see what you're talking about now. I should clarify the comments on the 'deepCopy()' function. I set the metatable as a pointer so I can check later (if the need were to arise, such as in the 'matrices') if they are equal. |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 30 Apr 2016 11:37 AM |
| Oh, okay then! That makes more sense than the comment describes. I can see why you did it that way then. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 11:39 AM |
| Was going to do large ordinals, but non-commutative addition and multiplication are hard. I have the addition part done, just... I don't fully understand multiplication for the large ordinals and there is like 0 documentation for it out there. rip aleph-null 2k16 |
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 30 Apr 2016 11:43 AM |
| I like your library; and to expand on your growing database of mathematical libraries, you could begin a mathematical knowledge engine. That would be quite the spectacle. Lua-based, of course. You could release it for ROBLOX and standalone on the web as well. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 11:55 AM |
@nox That would be quite interesting. It'd be like... Wolfram for Lua. Hm. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 30 Apr 2016 11:57 AM |
| There seems to be some code duplication in primes and euler scripts. You define some private functions (gcd, getFactors, lcm, etc.) that are used in Euler, but are later defined in Primes as public functions. You might want to consider refactoring so that the Euler script uses the public functions in prime. Other than that it looks really nice. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 12:00 PM |
@pwnedu46 Each modulescriptlet is meant to be standalone. I guess I could add what you had said, but personally, I'd prefer to keep them separate entities. I do appreciate the feedback, though.
But, then again, this is why I made it open-sourced. Go crazy! |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 07:51 PM |
| I pretty much have complex numbers done. Will finish and release tomorrow or late tonight, most likely. |
|
|
| Report Abuse |
|
|
|
| 01 May 2016 12:56 PM |
| I updated the math script to include complex numbers. I dunno what I'm going to do next. Maybe large ordinals, but... EH. |
|
|
| Report Abuse |
|
|