Skip to content

Commit dbfa8e9

Browse files
committed
make compile with latest V
1 parent 2cbe03b commit dbfa8e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

2024/11/leodev.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn main() {
1111
if stone == 0 {
1212
new_stones << 1
1313
} else {
14-
digits := if stone == 10 { 1 } else { int(math.log10(stone)) }
14+
digits := if stone == 10 { 1 } else { int(math.log10(f64(stone))) }
1515
if digits % 2 == 1 {
1616
power := i64(math.pow(10, digits / 2 + 1))
1717
new_stones << stone / power
@@ -56,7 +56,7 @@ fn (mut b Bruteforcer) force(stone i64, rem int) i64 {
5656
total = b.force(1, rem - 1)
5757
} else {
5858
// math.log10(10) is 0.9999999999 and rounds down to 0....
59-
digits := if stone == 10 { 1 } else { int(math.log10(stone)) }
59+
digits := if stone == 10 { 1 } else { int(math.log10(f64(stone))) }
6060
if digits % 2 == 1 {
6161
power := i64(math.pow(10, digits / 2 + 1))
6262
total = b.force(stone / power, rem - 1) + b.force(stone % power, rem - 1)

0 commit comments

Comments
 (0)