-
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
d44b950
commit 2db4c67
Showing
1 changed file
with
35 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,37 @@ | ||
べき乗を求める | ||
============== | ||
|
||
整数乗 | ||
------ | ||
|
||
べき乗を求めるには演算子(^)を使います。 | ||
|
||
```haskell | ||
> 3 ^ 8 | ||
6561 | ||
``` | ||
|
||
3を8乗しています。 | ||
演算子(^)の型は、つぎのようになります。 | ||
|
||
```haskell | ||
(^) :: (Num a, Integral b) => a -> b -> a | ||
``` | ||
|
||
実数乗 | ||
------ | ||
|
||
実数による、べき乗を求めるには演算子(\*\*)を使います。 | ||
|
||
```haskell | ||
> 3 ** 8 | ||
6561.0 | ||
> 2 ** (1 / 2) | ||
1.4142135623730951 | ||
``` | ||
|
||
演算子(\*\*)の型は、つぎのようになります。 | ||
|
||
```haskell | ||
(**) :: Floating a => a -> a -> a | ||
``` |