Chemical calculator: Difference between revisions

m
imported>Friman
m (→‎{{header|Wren}}: Minor tidy)
 
(2 intermediate revisions by one other user not shown)
Line 4,655:
{{libheader|Wren-fmt}}
{{libheader|Wren-str}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
import "./str" for Char, Str
 
var atomicMass = {
Line 4,829:
for (molecule in molecules) {
var mass = evaluate.call(replaceParens.call(molecule))
SystemFmt.print("%(Fmt.s(17, molecule))$17s -> %(Fmt$7.f(73f", massmolecule, 3))"mass)
}</syntaxhighlight>
 
Line 4,846:
Uue -> 315.000
</pre>
 
=={{header|zkl}}==
Really bad error checking
Line 5,037 ⟶ 5,038:
<assert 386.664,C27H46O>
<assert 315 ,Uue>
}();</syntaxhighlight>
 
{{out}}
Weight of H = 1.008.<br>
Weight of H2 = 2.016.<br>
Weight of H2O = 18.015.<br>
Weight of H2O2 = 34.014.<br>
Weight of (HO)2 = 34.014.<br>
Weight of Na2SO4 = 142.036.<br>
Weight of C6H12 = 84.162.<br>
Weight of COOH(C(CH3)2)3CH3 = 186.295.<br>
Weight of C6H4O2(OH)4 = 176.124.<br>
Weight of C27H46O = 386.664.<br>
Weight of Uue = 315.000.
9,476

edits