![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.
ruby_native_statistics
Advanced tools
This is a native extension to Ruby that adds native (C) statistical functions to the Array class. At present the following functions are provided:
Check the Github Actions build to see the currently supported versions of Ruby. This list will match whatever stable versions are specified at https://www.ruby-lang.org/en/downloads/.
It is generally more performant than calculating these values with pure Ruby. For a comparison, run the benchmarks with rake benchmark
.
Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
---|---|---|---|---|---|
bench_native_stdev | 0.000069 | 0.000074 | 0.000064 | 0.000065 | 0.000065 |
bench_ruby_stdev | 0.000947 | 0.000932 | 0.000927 | 0.000948 | 0.000909 |
Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
---|---|---|---|---|---|
bench_native_median | 0.000719 | 0.00067 | 0.000659 | 0.000638 | 0.000668 |
bench_ruby_median | 0.000774 | 0.000743 | 0.000724 | 0.000697 | 0.000683 |
Test (Ruby 3.3.0) | Run 1 | Run 2 | Run 3 | Run 4 | Run 5 |
---|---|---|---|---|---|
bench_native_mean | 0.000035 | 0.000035 | 0.000034 | 0.000032 | 0.000033 |
bench_ruby_mean | 0.000291 | 0.000287 | 0.000291 | 0.000299 | 0.000281 |
If you found a bug or need a particular function, please let me know! I work on this gem in my spare time, mainly for learning purposes. Feel free to open a PR or a Github issue and I'll take a look as soon as possible.
require 'ruby_native_statistics'
r = [1,3,21,32,42]
# calculate sample standard deviation, you can also use "stdevs"
p r.stdev
# calculate population standard deviation
p r.stdevp
# calculate mean
p r.mean
# calculate median
p r.median
# calculate percentile
p r.percentile(0.3333)
Percentile uses the same rounding method as Excel, sometimes called R7.
This is the third version of this gem, and it is a total rewrite of a SWIG-based design. Lots of thanks to the following resources:
FAQs
Unknown package
We found that ruby_native_statistics demonstrated a healthy version release cadence and project activity because the last version was released less than 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.