C language polynomial multiplication

xiaoxiao2021-03-06  38

C language - polynomial multiplication

/ * Level 5: Polynomial Multiplication Write by Arden for TLS 2005-01-21 in which parameters A [], B [], C [] are polynomial factors, M, N, K are polynomial highest times. The function completes R (X) * P (x) = Q (X) function. The coefficients in the array are arranged in accordance with the raised, that is, A [0] is the 0 set factor of X in R (x), then the number of INDEXs using the array can be obtained. Such as: m = 2, a [m] = {2.00, 2.00, 2.00} Represents Multi-class 2 2X 2XE2 function calculation results in the array c [] and number of times K * / # include

Void Muity (float a [], int m, float b [], int N, float c [], int * k) {INT I, J;

For (i = 0; i <= m; i ) for (j = 0; j <= n; j ) {c [i j] = a [i] * b [j]; // ranking Index can be used to represent the number of * k = i j; // printf ("a [% D]:% F / NB [% D]:% F / NC [% D]:% f / N", i , a [i], j, b [j], * k, c [* k]);}

For (i = 0; i <= * k; i ) Printf ("C [% D]:% F / N", I, C [I]);}

转载请注明原文地址:https://www.9cbs.com/read-63397.html

New Post(0)