.Modelica.Math.FastFourierTransform.Internal.prime235Factorization

Information

Syntax

(success, e2, e3, e5) = prime235Factorization(n);

Description

Compute the factorization of input Integer n in prime numbers 2, 3, and 5. If this is possible, success = true and e2 is the number of prime numbers2, e3 the number of prime numbers 3 and e5 the number of prime numbers 5. If this is not possible, success = false, and e2, e3, e5 are dummy values.

Example

(success, e2, e3, e5) = prime235Factorization(60)   // success=true, e2=2, e3=1, e5=1 (= 2^2*3^1*5^1)
(success, e2, e3, e5) = prime235Factorization(7)    // success=false

Interface

function prime235Factorization
  extends Modelica.Icons.Function;
  input Integer n;
  output Boolean success "= true, if factorization in 2,3,5 is possible";
  output Integer e2 "n = 2^e2*3^e3*5^e5";
  output Integer e3 "n = 2^e2*3^e3*5^e5";
  output Integer e5 "n = 2^e2*3^e3*5^e5";
end prime235Factorization;

Revisions

Date Description
Nov. 29, 2015 Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control.

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f