Skip to content

Commit

Permalink
feat: Update Github Actions and README
Browse files Browse the repository at this point in the history
  • Loading branch information
txaty committed Feb 10, 2025
1 parent 0710c34 commit a87e7db
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: success()
with:
token: ${{ secrets.CODECOV_TOKEN }}

analysis:
name: Codacy Analysis
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.PHONY: test test_race test_with_mock test_ci_coverage format bench report_bench cpu_report mem_report build

COVER_OUT := coverage.out
COVER_HTML := coverage.html

test: COVER_OPTS = -covermode count
test_race: COVER_OPTS = -race -covermode atomic
test_with_mock: COVER_OPTS = -race -gcflags=all=-l -covermode atomic

test test_race test_with_mock:
go test -v $(COVER_OPTS) -coverprofile=$(COVER_OUT) && go tool cover -html=$(COVER_OUT) -o $(COVER_HTML) && go tool cover -func=$(COVER_OUT) -o $(COVER_OUT)

test_ci_coverage:
go test -race -gcflags=all=-l -coverprofile=coverage.txt -covermode=atomic

format:
go fmt .

bench:
go test -bench . -benchmem -cpu 1

report_bench:
go test -cpuprofile cpu.prof -memprofile mem.prof -bench . -cpu 1

cpu_report:
go tool pprof cpu.prof

mem_report:
go tool pprof mem.prof

build:
go build -v ./...
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@

[![Go Reference](https://pkg.go.dev/badge/github.com/txaty/go-bigcomplex.svg)](https://pkg.go.dev/github.com/txaty/go-bigcomplex)
[![Go Report Card](https://goreportcard.com/badge/github.com/txaty/go-bigcomplex)](https://goreportcard.com/report/github.com/txaty/go-bigcomplex)
![Coverage](https://img.shields.io/badge/Coverage-45.8%25-yellow)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3a9bb5ff5cb64dcf83903ca998a9144d)](https://app.codacy.com/gh/txaty/go-merkletree/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)

Big complex number calculation library for Go (with [math/big](https://pkg.go.dev/math/big)).

Currently, the library supports:

1. Gaussian integer, complex numbers whose real and imaginary parts are both integers:

![gaussian_int](asset/image/gaussian_integer_formula.jpg)
$$
Z[i] = \{ a + bi \;|\; a, b \in \mathbb{Z} \}, \quad \text{where } i^2 = -1.
$$

2. Hurwitz quaternion, quaternions whose components are either all integers or all half-integers (halves of odd
integers; a mixture of integers and half-integers is excluded):

![hurwitz_int](asset/image/hurwitz_integer_formula.jpg)
$$
H = \{ a + bi + cj + dk \in \mathbb{H} \;|\; a, b, c, d \in \mathbb{Z} \; \text{or} \; b, c, d \in \mathbb{Z} + \frac{1}{2} \}.
$$

## Installation

Expand Down
Binary file removed asset/image/gaussian_integer_formula.jpg
Binary file not shown.
Binary file removed asset/image/hurwitz_integer_formula.jpg
Binary file not shown.

0 comments on commit a87e7db

Please sign in to comment.