Skip to content

fujiwat/calc-FSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calc -- Beautiful Calculator on the F# WebSharper-SPA

https://fujiwat.github.io/calc-FSharp/wwwroot/

Overview

This is a simple calculator with a decimal point. using F# WebSharper-SPA.

Requirement

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

Usage

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] [=]

Features

image image image image image image image image image image Corresponds to each digit in the number.
image Input the decimal point.
image Get Pi 3.14.....
image Get Sin for the displaying value. Value is radian only.
image Get Cosin for the displaying value. Value is radian only.
image Get tangent for the displaying value. Value is radian only.
image Backspace without decimap point ".".
image Calculate immediately.
image Clear the input value to zero.
image All Clear the first operand and 2nd operand.
image Get negative number for the displaying value.
image Get the inverse number for the displaying value.
image Calculate immediately and set the next operation as division.
image Calculate immediately and set the next operation as multiplication.
image Calculate immediately and set the next operation as subtraction.
image Calculate immediately and set the next operation as an addition.

Restrictions

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.

Reference

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

Author

Takahiro FUJIWARA https://www.linkedin.com/in/fujiwat/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors