Fractional api base on golang . golang math tools fractional molecular denominator

Mentioned in Awesome Go

gofal

中文文档

  • Fractional Operational Correlation API base on golang
  • Supporting Precision Operations
  • Supporting addition, subtraction, multiplication and division
  • Support chain expression
  • Support result output(flat64)

Example

1、 Add

	tmp := fractional.Model(7, 12)
	tmp1 := fractional.Model(1, 12)
	fmt.Println(tmp.Add(tmp1))
  • out
2/3

2、 Subtraction

	tmp = fractional.Model(1, 4)
	tmp1 = fractional.Model(1, 3)
	fmt.Println(tmp.Sub(tmp1))
  • out
-1/12

3、Multiplication

	tmp = fractional.Model(3, 4)
	tmp1 = fractional.Model(2, 3)
	fmt.Println(tmp.Mul(tmp1))
  • out
1/2

4、 Division

	tmp = fractional.Model(3, 4)
	tmp1 = fractional.Model(2, 3)
	fmt.Println(tmp.Div(tmp1))
  • out
9/8

5、 out put (flat64)

    tmp = fractional.Model(1, 3)
	fmt.Println(tmp.Verdict())
  • out
0.3333333333333333

6、Chain expression

	tmp := fractional.Model(1, 3)
	tmp.Add(fractional.Model(1)).Mul(tmp)
	fmt.Println(tmp)
  • out
16/9
  • All functions can support chain expressions
Owner
xxj
微信 : jnpher
xxj
Similar Resources

Gosfdc module - a collection of packages containing the data structures from the various Salesforce APIs and Tools

Gosfdc module - a collection of packages containing the data structures from the various Salesforce APIs and Tools

Jan 21, 2022

An interactive menu for Magisk's module installer with tools to alter Android

JD's Toolbox I'll update this with some details later, just getting the source code out for now... LICENSE The source code for JD's Toolbox is release

Jan 24, 2022

Various Dungeons and Dragons Tools. Written in go as an aid to learning the language.

dnd_tools Various Dungeons and Dragons Tools. Written in go as an aid to learning the language. Some tools are generic, while others will target eithe

Jan 28, 2022

Set of scripts & tools for converting between numbers and major system encoded words.

Set of scripts & tools for converting between numbers and major system encoded words.

major-system-converter Set of scripts & tools for converting between numbers and major system encoded words. Uses phonetics instead of letters to conv

Aug 9, 2022

Basic-api-with-go - A basic api with golang

I am creating my first API with GO. Install go get -u github.com/Yefhem/basic-ap

Jan 3, 2022

Go API wrapper for Greenhouse.io API

Greenhouse IO A Go interface to Greenhouse.io's API Useage Creating the Client NewClient accepts: A context; used for any HTTP requests made using the

Jan 14, 2022

A wrapper for the Wandbox API, written in Golang!

GoWandBox A simple wrapper for the WandBox API, written in Golang! Documentation can be found at classpythonaddike.github.io/gowandbox/ Note: This wra

Sep 19, 2021

Simple Golang API to demonstrate file upload to fireabase storage and retrieving url of uploaded file.

go-firebase-storage -Work in progress 🛠️ Simple Golang API that uses Firebase as its backend to demonstrate various firebase services using Go such a

Oct 4, 2021

Golang api for a league of legends teamfinder project

Golang api for a league of legends teamfinder project

League teamfinder API Golang api for a league of legends teamfinder project Table of Contents League teamfinder API Table of Contents Introduction Get

Nov 9, 2021
Golang Base Code

Golang Base Code Getting Started Clone repository. git clone [email protected]:mo-t

Dec 14, 2022
Go implementation of the XDG Base Directory Specification and XDG user directories

xdg Provides an implementation of the XDG Base Directory Specification. The specification defines a set of standard paths for storing application file

Dec 23, 2022
Atomic Arbitrage - A base example of a bare implementation of an arbitrage bot

Atomic Arbitrage Atomic Arbitrage is a base example of a bare implementation of

Nov 23, 2022
CapMonsterTool is a set of Go tools designed to simply make requests to the CapMonster Cloud API.

✨ CapMonsterTool ✨ About this module What is ✨ CapMonsterTool ✨ ? CapMonsterTool is a set of Go tools designed to simply make requests to the CapMonst

Dec 1, 2022
API and a set of tools to manage Netbox configuration declaratively

declarative-netbox An experimental project to explore the idea of managing the N

Jan 24, 2022
Mixin-sticker - Mixin sticker tools for golang

mixin-sticker mixin sticker bot spider python3 spider.py usage: spider.py [-h] [

Jan 4, 2022
frida debug tools
frida debug tools

fd windows下frida的调试工具 (单 exe,不需要python和nodejs) 现在他只支持USB english click here 预编译的二进制文件在这里下载 支持列表: 创建一个基于 frida-agent-example的typescript工程(拥有完美的智能提示) 使用

Dec 30, 2022
Go package providing tools for working with Library of Congress data.

go-libraryofcongress Go package providing tools for working with Library of Congress data. Documentation Tools $> make cli go build -mod vendor -o bin

Jan 3, 2023
Tools created for my OSCP preparation

goscp Set of tools created during my OSCP preparation. They include: gosheller - terminal based interface for cmdasp.aspx webshell. It provides intera

Dec 3, 2021
Generic tools for go 1.18+

Gtools Generic tools for go 1.18+ FT (func tools) Provide func tools over iterators Iterators for functions like Filter, Map, Reduce, etc solve 3 main

Jan 12, 2022