Coder Social home page Coder Social logo

rudxain / esomath.js Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 520 KB

Esoteric Mathematic Library for Javascript (past names: more-math-for-JS, mostly_math, NTML.js)

License: MIT License

JavaScript 100.00%
radix lucas-numbers functions factorial polygonal-number bitwise factors factorization mersenne fibonacci

esomath.js's Introduction

Me

Stats

Get cards like this one!

Personal

  • Have an "obsession" with code refactoring. It's obvious from my GH activity 😂
  • Considering moving to GitLab, for many reasons. The fact that GL nukes dead accounts is a deal-breaker for me. I've just learned about Code-Berg, it seems interesting.

Repos

  • When my PRs are merged, I'll delete my corresponding fork. Therefore, links to any of my forks may be broken (not dead, because it's not permanent) in the future. The exception is .files
  • I could delete any of my Gists without warning
  • All my repos use semver, except the ones that don't use versioning at all
  • If I contribute to any of your repos, I hope you do the same for me and/or other people :)

Langs

❤Favorites, in practice:

This takes into account all the stuff related to the langs (portability, std+community tools & libraries, ecosystem, documentation, etc...)

  1. Python
  2. JavaScript
  3. 🦀Rust
  4. POSIX Shell

One of the things I love about Rust is its honesty: Rust has abstractions (like any other lang), but they are leaky by design.

Rust [is] both as low-level as C, and as high-level as Lisp, whereas most other popular languages are stuck somewhere in the middle.

❤Favorites, in theory:

This only takes into account the langs in isolation (syntax, grammar, stdlib, etc...)

  1. 🦀Rust. For everything.
  2. Python. For expressing algorithms, because "haha, pseudo-code".
  3. Any lang that uses symbols rather than words (such as BrainFuck dialects), specially if the symbols have shapes that intuitively correspond to their operation.

My favorite argument against Python's colons is this:

The colons are an extra visual clue to scanning the blocks. As such, they improve readability, one of Python's main strengths.

Then Opening and closing braces should be called an "extra visual clue to scanning the block" in C++ and Java? Because they improved readability. Braces ({) then is C++, Java's main Strength.

As a logician, I love the way they point out the fallacy!

🧠Expertise:

Warning

this is subject to the Dunning-Kruger effect 😂 I'll try my best to list in an accurate order

This takes into account my knowledge of the lang (and everything related), and the experience making useful, efficient, and safe programs in it.

  1. Java Regular Expressions (I'm expert at optimizing them), CSV (any "dialect"), JSON
  2. 🦙Llamalab Automate. I know more about expressions than blocks
  3. Scratch
  4. JavaScript
  5. TypeScript
  6. POSIX shell
  7. MirBSD Korn Shell, ksh93, Dash
  8. Bash
  9. Python
  10. SVG ("subset" of XML)
  11. HTML
  12. CSS
  13. 🦀Rust
  14. C
  15. C++
  16. Go
  17. BrainFuck

👀Interested:

  1. 💾Assembly
  2. V
  3. APL
  4. (Common Lisp)
  5. 🕊Ada

Editors

Helix

I have experience with VScode and GNU Nano

OS

❤Favorites:

  1. Debian
  2. Android
  3. Microsoft Windows

🧠Expertise:

  1. Android 4 to 8.1, and 12. (0 experience with A[9, 11]). Most of my experience was from using TouchWiz, Samsung Experience, and OneUI. I do have some experience with AOSP (0 Gapps)
  2. Debian-based Linux distros
  3. ChromeOS. I have minimal knowledge about its internals. I know that most apps aren't native, but are powered by HTML+CSS+JS.
  4. Microsoft Windows XP, [7, 11] (I haven't touched Vista 💀). Despite using it my entire life, this beast is so bloated/complex that I know less than ~20% about it.

👀Interested:

  1. Redox
  2. Nix
  3. G Fuchsia

Browsers

  • Favorite (in practice): Mozilla Firefox
  • Fav (theory): LibreWolf

I also have expertise with Chromium-based browsers.

Terminals

  • Linux: GNOME Terminal (not Console)
  • Android: Termux

esomath.js's People

Contributors

rudxain avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

esomath.js's Issues

Localize all vars

Prevents external code from changing the behavior of the library by modifying property values of global objects that some functions depend on. This means using aliases to objects, and copying primitive values

Fix `isFinite` minor bug

There's wrong output when strings are large. This is a minor bug because the original/built-in also has it, so this has the lowest priority now

What should be the future of this library?

(More info at #2 )
I'm concerned about the future of this library because I want to take it seriously, but I feel like I don't know if the direction I'm going is a good goal.

This library started like my "Useless-Math" repo, just a bunch of functions lying around, and there was no clear direction to take. Then I realized what direction I wanted to take, I wanted this to be a polyfill. But polyfills are usually meant to be used in websites, and this library is definitely not a good idea to use in a website, but I already stated that in the README disclaimer. So now I'm wondering in what should this be focused on?

Add PowerSet?

I don't know if this should be implemented only on Set.prototype, or if I should also add it to Array.prototype, or maybe not add it at all. Is this actually useful in JS?

Add Dot Product?

This seems like a basic function to have, but I don't know if it should be added to this library

Use decorators

Decorators are functions that wrap other functions, essentially acting as functions that construct other functions. These are useful to apply common/shared behavior to many fns

Smarter min/max

It should return Number type only if it's a safe number, otherwise BigInt type, and only do that if there's multiple valid choices available

Test Workflow

This is a nice idea for automated testing, and would help to reach 100% code coverage. It's also a win-win situation for everyone using this lib and myself, since I won't need to install it on my system. lol I'm so lazy.

I'll activate the workflow after migrating everything to ESM format

Fix `IntN.parse` radix param precision loss

This has the lowest priority because radix is usually small (and should be), any absurdly large (2^53) BigInt or String value given to it is considered a misuse or an accident by the user or developer and I have no responsibility for that

Add missing step in `divisors`

There's missing multiplication and insertion at the end of the function. This step is required to include all even divisors and powers of 2

Name is not unique

The name NTML is already in use by an NPM package and by Microsoft. I should rename (again)

Focus on minimalism

I'm removing a lot of features, to make development easier, and to reduce redundancy (because other libraries already include those features)

Add test files

Even if the tests will be ran manually, there must be a test file to increase code coverage. This is a serious library, no bugs should be allowed

Fix `modpow` memory use

The IntN version has potential for avoidable out of memory errors when e < 2, while the Math version doesn't preserve precision when the exponent isn't an integer (there's no "modular multiplicative inverse" to correct this)

Add `modInv` and `egcd`

Add Modular Multiplicative Inverse, and Extended Euclidean Algorithm. modInv is useful to avoid wrong return values in Math.modPow

Fix `toFraction` and make use of it

The function should return the smallest fraction that when converted to Number yields exactly the same value as the original input, but some inputs cause it to loop too many times and return a bogus fraction. After fixing the bug, I plan on using it in Math.gcd to preserve precision of computations, and Math.factorize to get negative exponents

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.