kotlin-graphics / kotlin-unsigned Goto Github PK
View Code? Open in Web Editor NEWunsigned support for Kotlin via boxed types and unsigned operators
License: MIT License
unsigned support for Kotlin via boxed types and unsigned operators
License: MIT License
Code: println((-71777214294589696L).toBinaryString())
Output: 0000000000000000000000000000000000000000000000000000000000000000
$ ./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
Started Byte
, finish others plus Char
Hi! Please consider adding a license to your project.
Not having a license might prevent people from using your library.
Currently getting unresolved dependencies when attempting to use kotlin-glm due to its dependency on kotlin-unsigned.
Jitpack.io:
https://jitpack.io/#kotlin-graphics/kotlin-unsigned
Logs:
https://jitpack.io/com/github/kotlin-graphics/kotlin-unsigned/v3.3.32/build.log
"FAILURE: Build failed with an exception.
Hello!
There is no package unsigned
here: https://github.com/kotlin-graphics/kotlin-unsigned/blob/master/src/main/kotlin/unsigned/Long.kt.
Is it made on purpose or is it a bug? ;)
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.
It would be good to have one release with latest code that's compiled with stable Kotlin version. I can't use the latest release v2.4.2
with stable Kotlin version 1.1.51
as of now. Last release I can use is v2.3
.
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
.
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.
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 >=.
Not using unsigned numbers myself I can't be sure of all that there is available or not, but Kotlin 1.3 covers unsigned numbers doesn't it? https://kotlinlang.org/docs/reference/whatsnew13.html#unsigned-integers
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.
๐
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.
Hello!
What about this method and the same ones? Now I have to write u == Uint(0)
instead of u == 0
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.