| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
A Rust implementation of the Math module for mruby/edge.
This crate provides mathematical functions and constants for mruby/edge:
Add this to your Cargo.toml:
[dependencies]
mruby-math = "0.1.0"
mrubyedge = "1.1.1"Initialize the Math module in your VM:
use mruby_math::init_math;
use mrubyedge::yamrb::vm::VM;
let mut vm = VM::open(&mut rite);
init_math(&mut vm);# Calculate sine wave
x = Math::PI / 4
y = Math.sin(x)
# Calculate distance
distance = Math.hypot(3, 4) # => 5.0
# Exponential growth
result = Math.exp(2) # => e^2BSD-3-Clause
| Back | FazBrowse Home | New Git URL |