From 09:00 PM Friday, August 7 - 10:30 AM CST Saturday, August 8, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

factor (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: basic

Requires: MathScript RT Module

Syntax

c = factor(a)

Description

Computes the prime factorization of a given number. A number is prime if and only if the number is a positive integer with exactly one positive divisor other than 1.

Examples

Inputs

Name Description
a Specifies the number you want to factor. a is a positive integer. a has an upper limit of 2^32-1.

Outputs

Name Description
c Returns the set of prime numbers whose product equals a. c is a row vector of primes. The factors in c might repeat. For example, factor(16) returns the vector [2, 2, 2, 2].

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

C = factor(1000001)

Related Topics

is_prime
primes

WAS THIS ARTICLE HELPFUL?

Not Helpful