Skip to content

Commit 71087aa

Browse files
authored
Merge pull request #8878 from dotty-staging/add-macro-regression-test
Add regression test
2 parents 9158886 + 68b35eb commit 71087aa

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
private final val f64Pow5Split: Array[Long] = Macro.f64Pow5Split
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import scala.quoted._
2+
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

Comments
 (0)