Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some math #3

Merged
merged 1 commit into from Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Fable.Python.fsproj
Expand Up @@ -16,6 +16,7 @@
<Compile Include="stdlib/Os.fs" />
<Compile Include="stdlib/TkInter.fs" />
<Compile Include="stdlib/Queue.fs" />
<Compile Include="stdlib/Math.fs" />

<Compile Include="cognite-sdk/CogniteSdk.fs" />
<Compile Include="flask/Flask.fs" />
Expand Down
46 changes: 46 additions & 0 deletions src/stdlib/Math.fs
@@ -0,0 +1,46 @@
module Fable.Python.Math

open System
open Fable.Core

// fsharplint:disable MemberNames

type IExports =
abstract ceil : int -> int
abstract ceil : float -> int
abstract comb : int -> int -> int
abstract copysign : float -> int -> float
abstract fabs : float -> float
abstract factorial : float -> float
abstract floor : int -> int
abstract floor : float -> int
abstract fmod : int -> int -> int

abstract gcd : [<ParamArray>] ints: int[] -> int
abstract isfinite : float -> bool
abstract isfinite : int -> bool
abstract isinf : float -> bool
abstract isinf : int -> bool
abstract isnan : float -> bool
abstract isnan : int -> bool
abstract lcm : [<ParamArray>] ints: int[] -> int

abstract exp : float -> float
abstract expm1 : float -> float
abstract log : float -> float
abstract log1p : float -> float
abstract log2 : float -> float
abstract log10 : float -> float
abstract pow : float -> float -> float

abstract acos : float -> float
abstract asin : float -> float
abstract atan : float -> float
abstract atan2 : float -> float -> float
abstract cos : float -> float
abstract dist : float -> float -> float
abstract sin : float -> float
abstract tan : float -> float

[<ImportAll("math")>]
let math: IExports = nativeOnly