Code Monkey home page Code Monkey logo

kotlin-unsigned's People

Contributors

bixilon avatar cbeust avatar christxph avatar elect86 avatar lucodivo avatar servb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kotlin-unsigned's Issues

toBinaryString returns 0s

Code: println((-71777214294589696L).toBinaryString())
Output: 0000000000000000000000000000000000000000000000000000000000000000

Can't build

 $ ./kobaltw
            _  __          _               _   _
           | |/ /   ___   | |__     __ _  | | | |_
           | ' /   / _ \  | '_ \   / _` | | | | __|
           | . \  | (_) | | |_) | | (_| | | | | |_
           |_|\_\  \___/  |_.__/   \__,_| |_|  \__|  0.914

test {
/tmp/kobalt4764927415381874370.kt:15:1 Expecting a top level declaration
*****
***** ERROR Couldn't compile file: Expecting a top level declaration
*****
**** Version 0.916 is installed, you can switch to it with ./kobaltw --update

License missing

Hi! Please consider adding a license to your project.
Not having a license might prevent people from using your library.

Provide Mutable and Immutable Utypes

Now we can change var v so even val Utype is mutable. What about renaming currenty Utypes to MutableUtypes (like in Kotlin Notation) and providing Utypes with val that will be truly immutable? I will use those immutable classes.

Extension operator functions for standard types

Hello!

Is it possible to provide some extension operator functions for standard types?
Something like operator fun Int.plus(x: Uint): Int.

Now I have to write i + u.toInt() instead of i + u.

Removing Kobalt build script

It looks like Kobalt build scripts are not maintained here, as they still mention vesion 0.1 while the library is already version 3.0.6, and they don't have much in comparison to Gradle ones. Also I don't see if Kobalt supports Kotlin multi-platform projects -- @cbeust, please let me know if I'm wrong.
I don't see point in having two build systems in the project. So the question to library users is: does anybody have objections to removing Kobalt scripts? I'm open to discussions. If everyone is okay with this, I'll do that a bit later.

No static method compareUnsigned(II)I

I am getting the following error in my crash logs.

java.lang.NoSuchMethodError: No static method compareUnsigned(II)I in class Ljava/lang/Integer; or its super classes (declaration of 'java.lang.Integer' appears in /system/framework/core-libart.jar)
        at unsigned.Ushort.compareTo(Ushort.kt:87)

I'm not sure what this meant in the readme.

All unsigned methods available for ints and longs on java 1.8 have been reported here.
These are offered directly on the corresponding Int and Long Kotlin primitives (with infix too)

It is crashing when I'm comparing two Ushorts using >=.

Operations for signed and unsigned integer types of 128, 192, 256 bits

Theoretically these can be implemented via classes extending Number and based on several integer primitives. Currently all the stuff higher than 64 bits goes through BigInteger which is available in Kotlin/JVM only (which may be available in Kotlin stdlib some day).
Please leave a comment if anybody needs these types and / or are willing to work on that -- this could be useful when multi-platform version of the library is available.

Probable missuse of Optin

๐Ÿ‘‹

I found your library on #kotlinlang slack ๐Ÿ™‚.

Looking at arrays and gradle file, I'm a bit confused about the OptIn. If I'm right, you should not OptIn yourself, but propagate it (because you are building a library).

Here is a thread about this issue : https://kotlinlang.slack.com/archives/C3SGXARS6/p1696410990448249

Quoting CLOVIS-AI:

if you're making library, do not opt-in at the module-level, in fact, do not opt-in at all. Instead, propagate the warning to your users, otherwise their projects will break whenever this gets changed

You're calling a function which is marked as experimental by the @ExperimentalSerializationApi annotation.
If you want to propagate the experimental warning to your caller, just annotate your function with @ExperimentalSerializationApi as well, this way they get the same warning :)

I may be wrong.

Regards.

Add Uint.equals(Int)

Hello!

What about this method and the same ones? Now I have to write u == Uint(0) instead of u == 0.

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.