We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9158886 + 68b35eb commit 71087aaCopy full SHA for 71087aa
tests/pos-macros/f64Pow5Split/Lib.scala
@@ -0,0 +1,2 @@
1
+
2
+private final val f64Pow5Split: Array[Long] = Macro.f64Pow5Split
tests/pos-macros/f64Pow5Split/Macro.scala
@@ -0,0 +1,19 @@
+import scala.quoted._
3
+object Macro {
4
5
+ inline def f64Pow5Split: Array[Long] = ${ f64Pow5SplitExpr }
6
+ private def f64Pow5SplitExpr(using QuoteContext): Expr[Array[Long]] = Expr {
7
+ val ss = new Array[Long](652)
8
+ var pow5 = BigInt(1)
9
+ var i = 0
10
+ while (i < 652) {
11
+ ss(i) = (pow5 >> (pow5.bitLength - 121)).longValue & 0x3FFFFFFFFFFFFFFFL
12
+ ss(i + 1) = (pow5 >> (pow5.bitLength - 59)).longValue & 0x3FFFFFFFFFFFFFFFL
13
+ pow5 *= 5
14
+ i += 2
15
+ }
16
+ ss
17
18
19
+}
0 commit comments