DataTypeConversion_to_Double Icon
WIP.DataTypeConversion_to_Double
DataTypeConversion_to_Double(; saturate_on_overflow=false)Converts a real-valued input signal into a double-precision floating-point value.
Parameters
saturate_on_overflow: When enabled, inputs outside the double representable range are clamped to +/- 1.797e+308 (default: false)
Variables
u(t): Real-valued input signaly(t): Double-precision floating-point output
Description
Converts input to double-precision with floor rounding (fractional values rounded toward negative infinity). This block mimics Simulink's Data Type Conversion behavior when configured for double precision with Floor rounding.
Examples
to_double_floor(42.7, false) → 42.0
to_double_floor(-3.2, false) → -4.0
to_double_floor(1e12, false) → 1.0e+12Usage
PrimitiveComponents.WIP.DataTypeConversion_to_Double(saturate_on_overflow=false)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
saturate_on_overflow | – | false |
Connectors
u- This connector represents a real signal as an input to a component (RealInput)y- This connector represents a real signal as an output from a component (RealOutput)
Behavior
\[ \begin{align} y\left( t \right) &= to\_double\_floor\left( u\left( t \right), \mathtt{saturate\_on\_overflow} \right) \end{align} \]
Source
"""
DataTypeConversion_to_Double(; saturate_on_overflow=false)
Converts a real-valued input signal into a double-precision floating-point value.
# Parameters
- `saturate_on_overflow`: When enabled, inputs outside the double representable range are clamped to +/- 1.797e+308 (default: false)
# Variables
- `u(t)`: Real-valued input signal
- `y(t)`: Double-precision floating-point output
# Description
Converts input to double-precision with floor rounding (fractional values rounded toward negative infinity).
This block mimics Simulink's Data Type Conversion behavior when configured for double precision with Floor rounding.
# Examplestodoublefloor(42.7, false) → 42.0 todoublefloor(-3.2, false) → -4.0 todoublefloor(1e12, false) → 1.0e+12
"""</span>
<span class="hljs-keyword">component</span> DataTypeConversion_to_Double
<span class="hljs-symbol">u</span> = <span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/connectors/RealInput.html">RealInput</a></span>() {
"Dyad": {
"placement": {
"diagram": {"x1": -40, "x2": 0, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": -40, "x2": 0, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
}
}
}
<span class="hljs-symbol">y</span> = <span>Dyad.RealOutput</span>() {
"Dyad": {
"placement": {
"diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
}
}
}
# Clamp to +/- 1.797e+308 if overflow occurs
<span class="hljs-keyword">parameter</span> <span class="hljs-symbol">saturate_on_overflow</span>::<span>Boolean</span> = false
<span class="hljs-keyword">relations</span>
y = to_double_floor(u, saturate_on_overflow)
<span class="hljs-keyword">metadata</span> {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/Convert.svg"}}}
<span class="hljs-keyword">end</span></code></pre>
Flattened Source
"""
DataTypeConversion_to_Double(; saturate_on_overflow=false)
Converts a real-valued input signal into a double-precision floating-point value.
# Parameters
- `saturate_on_overflow`: When enabled, inputs outside the double representable range are clamped to +/- 1.797e+308 (default: false)
# Variables
- `u(t)`: Real-valued input signal
- `y(t)`: Double-precision floating-point output
# Description
Converts input to double-precision with floor rounding (fractional values rounded toward negative infinity).
This block mimics Simulink's Data Type Conversion behavior when configured for double precision with Floor rounding.
# Examplestodoublefloor(42.7, false) → 42.0 todoublefloor(-3.2, false) → -4.0 todoublefloor(1e12, false) → 1.0e+12
"""</span>
<span class="hljs-keyword">component</span> DataTypeConversion_to_Double
<span class="hljs-symbol">u</span> = <span class="hljs-link"><a href="https://help.juliahub.com/dyad/dev/stdlib/Dyad/connectors/RealInput.html">RealInput</a></span>() {
"Dyad": {
"placement": {
"diagram": {"x1": -40, "x2": 0, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": -40, "x2": 0, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
}
}
}
<span class="hljs-symbol">y</span> = <span>Dyad.RealOutput</span>() {
"Dyad": {
"placement": {
"diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
}
}
}
# Clamp to +/- 1.797e+308 if overflow occurs
<span class="hljs-keyword">parameter</span> <span class="hljs-symbol">saturate_on_overflow</span>::<span>Boolean</span> = false
<span class="hljs-keyword">relations</span>
y = to_double_floor(u, saturate_on_overflow)
<span class="hljs-keyword">metadata</span> {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/Convert.svg"}}}
<span class="hljs-keyword">end</span></code></pre>
Test Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses