Skip to main content
Glama
Calculator.fs725 B
module Calculator /// Simple calculator functions let add a b = a + b let subtract a b = a - b let multiply a b = a * b let divide a b = if b = 0 then failwith "Cannot divide by zero" else (float a) / (float b) /// More complex operations let square x = x * x let factorial n = if n <= 0 then 1 else let rec factorialHelper acc n = if n <= 1 then acc else factorialHelper (acc * n) (n - 1) factorialHelper 1 n /// Calculator type with instance methods type CalculatorClass() = member this.Add(a, b) = add a b member this.Subtract(a, b) = subtract a b member this.Multiply(a, b) = multiply a b member this.Divide(a, b) = divide a b

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryota-murakami/serena'

If you have feedback or need assistance with the MCP directory API, please join our Discord server