Numeric error propagation: Difference between revisions

m
→‎{{header|Kotlin}}: Fixed x2-y1-swap, c/f Java/Discussion
m (added a ;Related task: (bold) header.)
m (→‎{{header|Kotlin}}: Fixed x2-y1-swap, c/f Java/Discussion)
Line 1,138:
fun main(args: Array<String>) {
val x1 = Approx(100.0, 1.1)
val x2y1 = Approx(50.0, 1.2)
val y1x2 = Approx(200.0, 2.2)
val y2 = Approx(100.0, 2.3)
println(((x1 - x2).pow(2.0) + (y1 - y2).pow(2.0)).pow(0.5)) // => 111.80339887498948 ±2.938366893361004
}</lang>
{{out}}
<pre>111.80339887498948 ±2.9383668933610044871670631463423</pre>
 
=={{header|Mathematica}}==
Anonymous user