gananayantra-rusting
A professional-grade, multi-industry calculation engine written in Rust.
Overview
gananayantra provides reusable, library-first calculators across diverse domains. All functions are pure, return Result<f64, String>, and perform input validation.
This is a library crate. No CLI is included.
Features by Industry
| Industry | Calculators |
|---|---|
| Finance | ROI, Time Value of Money, Compound Interest |
| Health | BMI, BMR, Body Fat %, Calorie Requirements |
| Energy | Power Consumption, Electricity Cost |
| Geo | Earth Distance (Haversine), Horizon Distance |
| Water | Pressure at Depth, River Flow Rate |
| Space | Orbital Velocity, Escape Velocity, Orbital Period |
| Utilities | Percentage Calculations |
Installation
Add to your Cargo.toml:
[]
= "1.1"
Usage Examples
Finance: Future Value Calculation
use future_value;
let fv = future_value.unwrap;
println!; // ~$14,693.28
Health: BMI Calculation
use bmi;
let result = bmi.unwrap;
println!; // ~22.86
Space: Orbital Velocity
use orbital_velocity;
let velocity = orbital_velocity.unwrap;
println!; // ~7,670 m/s
API Design
All public functions follow these principles:
- Pure functions: No side effects or I/O
- Type-safe: Strong typing with validation
- Error handling: Returns
Result<f64, String> - Documented: Rustdoc comments with examples
License
MIT License - see LICENSE for details.