Skip to content

Commit

Permalink
refactor multiply
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Wanke <[email protected]>
  • Loading branch information
skyz1 and JonasWanke authored Aug 1, 2023
1 parent 9a75e62 commit f4507ad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/Core/fixedDecimal.candy
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ negate value :=
multiply factorA factorB :=
needs (is factorA)
needs (is factorB)
targetScale = factorA | scale | int.add (factorB | scale)
fromIntScaled
rescaledMinorUnits factorA targetScale | int.multiply (rescaledMinorUnits factorB targetScale)
| int.divideTruncating (scaleFactor targetScale)
targetScale
factorA | minorUnits | int.multiply (factorB | minorUnits)
factorA | scale | int.add (factorB | scale)
divideTruncating dividend divisor :=
needs (is dividend)
needs (is divisor)
Expand Down

1 comment on commit f4507ad

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on f4507ad Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: f4507ad Previous: 83cb450 Ratio
Time: Compiler/hello_world 26306370 ns/iter (± 1840043) 24982559 ns/iter (± 3412713) 1.05
Time: Compiler/fibonacci 216987152 ns/iter (± 10906642) 222455421 ns/iter (± 11086515) 0.98
Time: VM Runtime/hello_world 66500 ns/iter (± 37102) 70950 ns/iter (± 35084) 0.94
Time: VM Runtime/fibonacci/15 587349881 ns/iter (± 19556133) 640840662 ns/iter (± 16354893) 0.92
Time: VM Runtime/PLB/binarytrees/6 2585498418 ns/iter (± 70635590) 2915153673 ns/iter (± 54214207) 0.89

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.