https://github.com/hacimertgokhan/fsharpmathbasics
F# math examples
https://github.com/hacimertgokhan/fsharpmathbasics
Last synced: 1 day ago
JSON representation
F# math examples
- Host: GitHub
- URL: https://github.com/hacimertgokhan/fsharpmathbasics
- Owner: hacimertgokhan
- Created: 2024-02-29T22:31:15.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-09T17:43:15.000Z (about 1 year ago)
- Last Synced: 2025-03-27T21:15:47.463Z (7 months ago)
- Language: F#
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# F# Kodu Açıklaması
Bu F# kodu, kullanıcıdan sürekli olarak bir sayı girmesini ister ve belirli matematiksel işlemleri gerçekleştirir. İşte kodun adım adım açıklaması:
## Kod
```fsharp
open System
let rec do_math_funcs() =
let mutable bool = true;
while (bool) do
printfn "Numara giriniz ya da çıkış yapınız (*0*)"
let item = Console.ReadLine()
if item = "*0*" then
bool <- false
else
let rec factorial x =
if x < 1 then 1
else x * factorial (x-1)
Printf.printfn "Faktöriyel: %d" (factorial (Int32.Parse(item)))
let rec sqrt x =
if x >= 1 then x * x
else 1
Printf.printfn "Karesi : %d" (sqrt (Int32.Parse(item)))
match Int32.TryParse(item) with
| (true, value) -> printfn ""
| _ -> printfn ""
do_math_funcs();
```