From cc2d76c0f1c3f7c5ae626923fb74955e2697059e Mon Sep 17 00:00:00 2001 From: PottierLoic Date: Mon, 15 Jul 2024 23:45:28 +0200 Subject: [PATCH] poly: fix typo --- examples/poly_operations/main.v | 6 +++--- poly/poly.v | 2 +- poly/poly_test.v | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/poly_operations/main.v b/examples/poly_operations/main.v index adf818861..c7ebb399d 100644 --- a/examples/poly_operations/main.v +++ b/examples/poly_operations/main.v @@ -10,10 +10,10 @@ fn main() { result_add := poly.add(poly_1, poly_2) println('Addition result: ${result_add}') - // Substraction + // Subtraction // Degree is not modified unless highest coefficients cancel each other out - result_sub := poly.substract(poly_1, poly_2) - println('Substraction result: ${result_sub}') + result_sub := poly.subtract(poly_1, poly_2) + println('Subtraction result: ${result_sub}') // Multiplication // with given degree n and m for poly_1 and poly_2 diff --git a/poly/poly.v b/poly/poly.v index d53f8e5fd..e050a4290 100644 --- a/poly/poly.v +++ b/poly/poly.v @@ -275,7 +275,7 @@ pub fn add(a []f64, b []f64) []f64 { return c } -pub fn substract(a []f64, b []f64) []f64 { +pub fn subtract(a []f64, b []f64) []f64 { na := a.len nb := b.len nc := int(math.max(na, nb)) diff --git a/poly/poly_test.v b/poly/poly_test.v index 068edda4c..0d33c8ce1 100644 --- a/poly/poly_test.v +++ b/poly/poly_test.v @@ -30,10 +30,10 @@ fn test_add() { assert add(a, b) == [7.0, 22, -7] } -fn test_substract() { +fn test_subtract() { a := [6.0, 777, -3] b := [1.0, -755, -4] - assert substract(a, b) == [5.0, 1532, 1] + assert subtract(a, b) == [5.0, 1532, 1] } fn test_multiply() {