Skip to content

fun math - what could be done differently in Go

License

Notifications You must be signed in to change notification settings

cirethic/go-lab

Repository files navigation

Cantor pair function in Go

1. cantor pair function

image

cantor pair function reference

https://en.wikipedia.org/wiki/Cantor_function

https://en.wikipedia.org/wiki/Pairing_function

https://gist.github.com/hannesl/8031402 



go run main.go

**func cantor_pair_calculate()**
33, 1  =>  596
6, 8  =>  113
596, 113  =>  251808

**func cantor_pair_reverse()**
251808 =>  596, 113
596 => 33, 1
113 => 6, 8

About

fun math - what could be done differently in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published