Coder Social home page Coder Social logo

go-utils's Introduction

Hi there! I'm Omnikron13, or Joey if our paths happen to cross in the real world. Aged Comp. Sci. student, scatterbrain, and itinerant tinkerer extraordinaire.

Due to some kind of unfortunate mishap int the factory I was evidently accidently constructed with a rather severe ADHD fault, though serendipitiy saw fit that this curiously seems to have imbued me with a near pathological interest in literally everything. If you can learn about it, what it means, what it does, how it works, why it doesn't... I want to know. Really rather insatiable to be honest.

As you are presumably crossing paths with me in some way right now... let me say I'm delighted to meet you! And I do hope we get to build something interesting together!

go-utils's People

Contributors

omnikron13 avatar

Watchers

 avatar

go-utils's Issues

Benchmark Abs()

Bench the naive first draft Abs() vs. native casting to & from float64 and math.Abs

This should follow a reworking of Abs() to handle the min values of signed integer types (probably panicicking).

Handle signed integer overflow in `Abs()`

Abs() will overflow back to a negative value if passed an unsigned integer of the minimum value of its type.

This behaviour needs to be dealt with somehow. Options are:

  • panic - this has the advantage of very explicitly allowing the user to decide how to handle this situation.
  • return the maximum value for the type - I don't favour this, as it (re)introduces a silent innaccuracy for the user.
  • continue to return the unchanged value, and clearly document this behaviour - this also allows the user to decide how
    to handle this, though less explicit than panicking so I think I favour this less

Sort std lib math functions

Sort funcs

Sort all the math package functions into one of these categories:

  • No intention past simply wrapping the input in a float64() cast, and returning the normal float64
  • Suitable to return the same type passed in
  • Candidate for additional functions to control e.g. rounding
  • Finished, at least presumed to be

Wrap

 TODO: Sort further into functions to literally pass through, and those that can still take generic args?

  • func Acos(x float64) float64
  • func Acosh(x float64) float64
  • func Asin(x float64) float64
  • func Asinh(x float64) float64
  • func Atan(x float64) float64
  • func Atan2(y, x float64) float64
  • func Atanh(x float64) float64
  • func Cos(x float64) float64
  • func Cosh(x float64) float64
  • func Erf(x float64) float64
  • func Erfc(x float64) float64
  • func Erfcinv(x float64) float64
  • func Erfinv(x float64) float64
  • func Exp(x float64) float64
  • func Exp2(x float64) float64
  • func Expm1(x float64) float64
  • func Inf(sign int) float64
  • func IsInf(f float64, sign int) bool
  • func IsNaN(f float64) (is bool)
  • func J0(x float64) float64
  • func J1(x float64) float64
  • func Jn(n int, x float64) float64
  • func NaN() float64
  • func Nextafter(x, y float64) (r float64)
  • func Nextafter32(x, y float32) (r float32)
  • func Pow(x, y float64) float64
  • func Pow10(n int) float64
  • func Signbit(x float64) bool
  • func Sin(x float64) float64
  • func Sincos(x float64) (sin, cos float64)
  • func Sinh(x float64) float64
  • func Tan(x float64) float64
  • func Tanh(x float64) float64
  • func Y0(x float64) float64
  • func Y1(x float64) float64
  • func Yn(n int, x float64) float64

 TODO: check why I seperated this out...

  • func Hypot(p, q float64) float64

 TODO: move these out to a pure-passthrough file?

  • func Float32bits(f float32) uint32
  • func Float32frombits(b uint32) float32
  • func Float64bits(f float64) uint64
  • func Float64frombits(b uint64) float64

Match type

  • func Copysign(f, sign float64) float64
  • func Max(x, y float64) float64
  • func Min(x, y float64) float64
  • func Mod(x, y float64) float64
  • func Modf(f float64) (int float64, frac float64)
  • func Ilogb(x float64) int

Possible extras

  • func Sqrt(x float64) float64
  • func Cbrt(x float64) float64
  • func Log(x float64) float64
  • func Log10(x float64) float64
  • func Log1p(x float64) float64
  • func Log2(x float64) float64
  • func Logb(x float64) float64
  • func Trunc(x float64) float64
  • func Remainder(x, y float64) float64
  • func Round(x float64) float64
  • func RoundToEven(x float64) float64
  • func Floor(x float64) float64
  • func Ceil(x float64) float64

Finished

  • func Abs(x float64) float64

Dump of symbols from go doc -short math

  • func Dim(x, y float64) float64
  • func FMA(x, y, z float64) float64
  • func Frexp(f float64) (frac float64, exp int)
  • func Gamma(x float64) float64
  • func Ldexp(frac float64, exp int) float64
  • func Lgamma(x float64) (lgamma float64, sign int)

Add wrapped_test.go


Add wrapped_test.go

  • All functions need tests ensuring they produce the same results as manually casting to the std lib math.* versions
  • Inference of generic return types needs testing.

Add badges to README files

Add the relevant useful/standard quick info badges to the README files.

  • Basic versions OK to go with current tooling
  • LICENCE (this one is static, so should be easy, but I'm still debating ClearPL...)
  • Build passing/failing (atm per sub-dir? so just maths..?)
  • Open issues - should probably split this into at least bugs/non-bugs, etc...
  • dependabot
  • Waiting on go-devoptions tooling
    • Code coverage
    • docs link - will rely on custom tooling from go-devoptions for gh-pages version
  • Waiting on being meaningful
    • Latest release (there are variants of this - investigate)
    • Open PRs
    • go.dev link(s)

Drafts

  • Tests/checks
  • Coverage
    • NOTE: this is just hardcoded at 100%
      Waiting on go-devoptions work really?
  • Something to alert for swings (positive or negative) either decent sized but isolated, or modest but broad?
  • latest commit/activity
    • NOTE: With some fancy tooling this could display info about commits, merges

Sort for relation to CI?

Whether or not all automated tests passed on all targetted platforms
% of statements automated testing reached at least once

Sort for relation to interaction & activity?

Last commit (?)
All open issues

  • open issues
    • NOTE: again, would be better tracking bug/non-bug/untriaged really
  • Pending need
  • Help wanted = not currently!
  • Open PRs
  • Latest release - currently pretty pointless?


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.