Add get level from hexagon#15
Conversation
| for { | ||
| digit <- choose(0, 9) | ||
| curr <- gen | ||
| } yield curr + digit * (Math.pow(10, pos).toLong) |
There was a problem hiding this comment.
For this you could generate random characters from '0' to '9' and then use the String-argument BigInt constructor.
There was a problem hiding this comment.
I'm not sure but probably summing BigInts is faster than parsing String
|
@shishkin can you have a look at this? I would like to use this code. |
|
Thanks for your effort here. I'm not sure exposing |
| organization := "net.teralytics", | ||
| name := "geohex", | ||
| version := "0.1." + sys.env.getOrElse("TRAVIS_BUILD_NUMBER", "0-SNAPSHOT"), | ||
| version := "0.2." + sys.env.getOrElse("TRAVIS_BUILD_NUMBER", "0-SNAPSHOT"), |
There was a problem hiding this comment.
At this point, API of the library is in complete flux and every change is potentially breaking. Especially around JS/JVM interop. I'd refrain from giving a false sense of compatibility and stick to 0.1.x for now.
|
The reason why I and @ilyabo in particular are not using |
|
Then I'd rather make |
|
Honestly, I don't think this tiny improvement is worth spending much time in discussions :) Anyways, here's a quick benchmark: I also think If we don't have this function in terahex, we'll end up using the helper functions on both Scala and JS sides for that, as now, which is a bad thing, because it's part of the implementation detail which we shouldn't rely upon and even worse have it reimplemented in multiple places. |
No description provided.