Floating Point Arithmetic Sample - vilinski/nemerle GitHub Wiki

Floating Point Arithmetic

  • Category: Arithmetic
  • Description: This sample shows some basic floating point arithmetic
  • Code:
using System;
using System.Console;

    def x = 20.0 + 35.0 - 4.0;
    def y = x * 3.0 + 1.0;
    def r1 = x / 2.5;
    WriteLine($"x = $x, y = $y, r1 = $r1")
  • Execution Result:
x = 51, y = 154, r1 = 20.4

  • Copyright
Samples used from "F# 3.0 Sample Pack" (http://fsharp3sample.codeplex.com/) at Codeplex OpenSource Community for non-commercial usage. All copyrights and authorship on materials this publication based on, is belongs to Microsoft corp. Copyright © 2006-2011 Microsoft Corporation, . All rights reserved. Copyright and autorship for materials in Nemerle language belongs to Nemerle Project Team. Copyright © 2008-2011 Nemerle Project Team. All rights reserved.
⚠️ **GitHub.com Fallback** ⚠️