You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_sources/dotnet/numbers.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Numeric types
2
2
3
-
In Fable, we use F# numeric types, which are all translated to JS Number (64-bit floating type) at the exception of `int64`, `uint64`, `bigint` and `decimal`.
3
+
In Fable, we use F# numeric types, which are all translated to Python integers at the exception of `float`, `double`, and `decimal`.
4
4
5
-
Fable numbers are very nearly compatible with .NET semantics, but translating into Javascript types has consequences:
5
+
Fable numbers are very nearly compatible with .NET semantics, but translating into Python types has consequences:
6
6
7
7
* (non-standard) All floating point numbers are implemented as 64 bit (`double`). This makes `float32` numbers more accurate than expected.
8
8
* (non-standard) Arithmetic integers of 32 bits or less are implemented with different truncation from that expected, as whole numbers embedded within `double`.
<h1>Numeric types<aclass="headerlink" href="#numeric-types" title="Permalink to this headline">¶</a></h1>
287
-
<p>In Fable, we use F# numeric types, which are all translated to JS Number (64-bit floating type) at the exception of <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">uint64</span></code>,<codeclass="docutils literal notranslate"><spanclass="pre">bigint</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">decimal</span></code>.</p>
288
-
<p>Fable numbers are very nearly compatible with .NET semantics, but translating into Javascript types has consequences:</p>
287
+
<p>In Fable, we use F# numeric types, which are all translated to Python integers at the exception of <codeclass="docutils literal notranslate"><spanclass="pre">float</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">double</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">decimal</span></code>.</p>
288
+
<p>Fable numbers are very nearly compatible with .NET semantics, but translating into Python types has consequences:</p>
289
289
<ulclass="simple">
290
290
<li><p>(non-standard) All floating point numbers are implemented as 64 bit (<codeclass="docutils literal notranslate"><spanclass="pre">double</span></code>). This makes <codeclass="docutils literal notranslate"><spanclass="pre">float32</span></code> numbers more accurate than expected.</p></li>
291
291
<li><p>(non-standard) Arithmetic integers of 32 bits or less are implemented with different truncation from that expected, as whole numbers embedded within <codeclass="docutils literal notranslate"><spanclass="pre">double</span></code>.</p></li>
<pclass="card-text">Type safety without the hassle</p>
283
+
<pclass="card-text"><spanclass="icon is-small has-text-black"><iclass="fas fa-lock fa-2x"></i></span><strong>Type safety without the hassle</strong></p>
293
284
</div>
294
285
<divclass="card-body docutils">
295
286
<pclass="card-text">Type inference provides robustness and correctness, but without the cost of additional code. Let the compiler catch bugs for you.</p>
0 commit comments