Skip to Main Content Skip to Search
Product Documentation

sqrt - Square root of fi object

Syntax

c = sqrt(a)
c = sqrt(a,T)
c = sqrt(a,F)
c = sqrt(a,T,F)

Description

This function computes the square root of a fi object using a bisection algorithm.

c = sqrt(a) returns the square root of fi object a. Intermediate quantities are calculated using the fimath associated with a. The numerictype object of c is determined automatically for you using an internal rule.

c = sqrt(a,T) returns the square root of fi object a with numerictype object T. Intermediate quantities are calculated using the fimath associated with a. See Data Type Propagation Rules.

c = sqrt(a,F) returns the square root of fi object a. Intermediate quantities are calculated using the fimath object F. The numerictype object of c is determined automatically for you using an internal rule. When a is a built-in double or single data type, this syntax is equivalent to c = sqrt(a) and the fimath object F is ignored.

c = sqrt(a,T,F) returns the square root fi object a with numerictype object T. Intermediate quantities are also calculated using the fimath object F. See Data Type Propagation Rules.

sqrt does not support complex, negative-valued, or [Slope Bias] inputs.

Internal Rule

For syntaxes where the numerictype object of the output is not specified as an input to the sqrt function, it is automatically calculated according to the following internal rule:

Data Type Propagation Rules

For syntaxes for which you specify a numerictype object T, the sqrt function follows the data type propagation rules listed in the following table. In general, these rules can be summarized as "floating-point data types are propagated." This allows you to write code that can be used with both fixed-point and floating-point inputs.

Data Type of Input fi Object aData Type of numerictype object TData Type of Output c
Built-in doubleAnyBuilt-in double
Built-in singleAnyBuilt-in single
fiFixedfiFixedData type of numerictype object T
fiScaledDoublefiFixedScaledDouble with properties of numerictype object T
fidoublefiFixedfidouble
fisinglefiFixedfisingle
Any fi data typefidoublefidouble
Any fi data typefisinglefisingle

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS