Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.25 KB

File metadata and controls

48 lines (35 loc) · 1.25 KB

Atomic Arithmetic

Inspired by Tailwind CSS.

A utility-first arithmetic framework packed with functions like Add23, Subtract8921, MultiplyBy5522 and DivideBy7 that can be composed to compute any number, directly in your Go code. Atomic Arithmetic is unapologetically modern, and takes advantage of all the latest and greatest Go features to make the developer experience as enjoyable as possible.

Build whatever you want, without touching pesky arithmetic operators. Currently supports numbers up to 10,000, which should be enough for most applications.

Usage

Import the operations package to use the atomic arithmetic functions. Fast, built-in autocomplete in most IDEs!

package main

import "github.com/initialcapacity/atomic-arithmetic/pkg/operations"

func main() {
	operations.Add365(17)
	operations.Subtract714(893)
	operations.MultiplyBy199(87)
	operations.DivideBy342(744)
	operations.Mod17(654)
}

Run the demo to see these examples in action.

go run ./cmd/demo

Development

  1. Re-generate the operations package.

    go ./cmd/generate
  2. Run the extensive test suite.

    go test ./...