-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
852a13f
commit fb3236d
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,54 @@ | ||
対数計算を行う | ||
============== | ||
|
||
自然対数 | ||
-------- | ||
|
||
自然対数を求めるには関数logを使います。 | ||
|
||
```haskell | ||
> log 10 | ||
2.302585092994046 | ||
``` | ||
|
||
関数logの型は、つぎのようになります。 | ||
|
||
```haskell | ||
log :: Floating a => a -> a | ||
``` | ||
|
||
底を指定 | ||
-------- | ||
|
||
底を指定して、対数を求めるには関数logBaseを使います。 | ||
|
||
```haskell | ||
> logBase 10 10000 | ||
4.0 | ||
> logBase 2 128 | ||
7.0 | ||
``` | ||
|
||
関数logBaseの型は、つぎのようになります。 | ||
|
||
```haskell | ||
logBase :: Floating => a -> a -> a | ||
``` | ||
|
||
ネイピア数のべき乗 | ||
------------------ | ||
|
||
ネイピア数のべき乗を求めるには関数expを使います。 | ||
|
||
```haskell | ||
> exp 1 | ||
2.718281828459045 | ||
> exp 3 | ||
20.085536923187668 | ||
``` | ||
|
||
関数expの型は、つぎのようになります。 | ||
|
||
```haskell | ||
exp :: Floating a => a -> a | ||
``` |