![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Basic vector operations over the rational numbers.
where m.r
is the rationals used by momenta
var m = require('momenta');
m([1])[0] === m.r(1); // true
while in the case of rationals it made sense to keep direct equality between the created objects, I think this is not the case with momentai. However this might change some time in the future.
Another issue is that no matter how much I wish, there isn't a good, widely supported way to subclass array (not until es6 is widely supported). The workarounds available kinda create more problems than they solve, so after a day of thinking I went in the minimalist direction. This also means, that while momenta methods expect arrays and scalars with add, sub, scale, disperse, dot methods on them, the module's user should provide these methods.
Probably worth to mention that the API gives you easy solution to this:
var m = require('momenta');
var equal = require('deep-equal');
var r = m.r;
equal(m.disperse(m([1,4,7,9,16]), r(12)), m([r(1,12),r(1,3),r(7,12),r(3,4),r(4,3)])); // true
all methods on momenta objects will return an array of rationals
with the exception of .dot
, which will return a single rational
momenta()
m([3])[0].toString() // 3/1
momenta.r()
m.r(5).toString() // 5/1
scale
m.scale(m([1,3,5]), m.r(7)) // [7/1,21/1,35/1]
disperse
m.disperse(m([1,3,5]), m.r(9)) // [1/9,1/3,5/9]
add
m.add(m([1,3,5]), m([2,4,6])) // [3/1,7/1,11/1]
sub
m.sub(m([3,7,11]), m([2,4,6])) // [1/1,3/1,5/1]
dot
m.dot(m([1,3,5]), m([7,11,13])) // 105/1
cross
m.cross(m([1,3,5]), m([7,11,13])) // [-16/1, 22/1, -10/1]
npm install momenta
You can use it in the browser with browserify
FAQs
Basic vector operations
The npm package momenta receives a total of 1 weekly downloads. As such, momenta popularity was classified as not popular.
We found that momenta demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.