This is a simple calculator with a decimal point. using F# WebSharper-SPA.
Modern Web Browser Visual Studio 2022 For the development environment, following commands are needed:
> dotnet new -i WebSharper.Templates
> dotnet tool install -g dotnet-ws
> cd c:\<parent-folder-of-the-projects>
> dotnet new websharper-spa -lang f# -n <project-name>
> cd <project-name>
> dotnet add package WebSharper.UI
> dotnet tool install -g dotnet-ws
Just Click the buttons as same as the physical regular calculator. If you want to get the result of 1 + 2 * 3 then that means 1 + (2 * 3) = 7 therefore you need to click following order:
[2] [*] [3] [+] [1] [=]
When you click the buttons for * / - + then the calculation is immediately occurred. Therefore, if you click buttons by the following order then the result is ( 1 + 2 ) * 3 = 9:
[1] [+] [2] [*] [3] [=]
Corresponds to each digit in the number.
Input the decimal point.
Get Pi 3.14.....
Get Sin for the displaying value. Value is radian only.
Get Cosin for the displaying value. Value is radian only.
Get tangent for the displaying value. Value is radian only.
Backspace without decimap point ".".
Calculate immediately.
Clear the input value to zero.
All Clear the first operand and 2nd operand.
Get negative number for the displaying value.
Get the inverse number for the displaying value.
Calculate immediately and set the next operation as division.
Calculate immediately and set the next operation as multiplication.
Calculate immediately and set the next operation as subtraction.
Calculate immediately and set the next operation as an addition.
The calculation values are using double which means 64bit IEEE floating-point number type. Sometimes it causes a margin of error therefore this program round to the 10th decimal place.
This program is derived from the following source code and modified the color and added functions "1/x", "Sin", "Cos", "Tan", and decimal point.
https://try.websharper.com/snippet/adam.granicz/00002I
Web-font 'Quantico' is used from the following google font.
https://fonts.google.com/specimen/Quantico
Takahiro FUJIWARA https://www.linkedin.com/in/fujiwat/
