Skip to content

Commit

Permalink
run fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
PottierLoic committed Sep 10, 2024
1 parent 2f05eb1 commit d0b4fd5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/poly_operations/main.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ fn main() {
// Division TODO:Fix this
// Result includes the quotient and the remainder
// To get the real remainder, divide it by the divisor.
poly_dividend := [2.0, -4.0, -4.0, 1.0] // 2 - 4x - 4x^2 + x^3
poly_divisor := [-2.0, 1.0] // -2 + x

// OLD WAY
// poly_dividend := [2.0, -4.0, -4.0, 1.0] // 2 - 4x - 4x^2 + x^3
// poly_divisor := [-2.0, 1.0] // -2 + x

// REVERSED WAY
poly_dividend := [1.0, -4.0, -4.0, 2.0] // 2 - 4x - 4x^2 + x^3
poly_divisor := [1.0, -2.0] // -2 + x

quotient, remainder := poly.divide(poly_dividend, poly_divisor)
println('Division quotient: ${quotient}') // Expected quotient: [-8.0, -2.0, 1.0] (-8 - 2x + x^2)
println('Division remainder: ${remainder}') // Expected remainder: [-14.0]
Expand Down

0 comments on commit d0b4fd5

Please sign in to comment.