Skip to content

Commit

Permalink
test implementation of signature on simple.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanRL committed May 18, 2020
1 parent 528cfd8 commit 0461fc2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
41 changes: 33 additions & 8 deletions docs/arithmetic/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ The following methods are available for classes that implement `SimpleNumberInte

If the provided `$value` matches none of these, an exception of type `Samsara\Exceptions\UsageError\IntegrityConstraint` is thrown.

###### add(mixed $num): NumberInterface
!!! signature "add(mixed $num): NumberInterface"
$num
: Accepts a mixed value that is limited to the formats detailed in the [Available Methods](#available-methods) section.

returns
: Returns an object of the same class as the calling class if the resulting value can be represented with a `SimpleNumberInterface`. Returns an object of the `ImmutableComplexNumber` class if the resulting value has both a real and imaginary component.

This function adds the current value with `$num` and returns the result.

Expand Down Expand Up @@ -108,8 +113,13 @@ This function adds the current value with `$num` and returns the result.
echo 'Circuit State: '.$newCircuitState;
// Prints: 'Circuit State: 10+20i'
```

!!! signature "subtract(mixed $num): NumberInterface"
$num
: Accepts a mixed value that is limited to the formats detailed in the [Available Methods](#available-methods) section.

###### subtract(mixed $num): NumberInterface
returns
: Returns an object of the same class as the calling class if the resulting value can be represented with a `SimpleNumberInterface`. Returns an object of the `ImmutableComplexNumber` class if the resulting value has both a real and imaginary component.

This function subtracts `$num` from the current value and returns the result.

Expand Down Expand Up @@ -187,8 +197,13 @@ This function subtracts `$num` from the current value and returns the result.
echo 'Circuit State: '.$newCircuitState;
// Prints: 'Circuit State: 2+20i'
```

###### multiply(mixed $num): NumberInterface

!!! signature "multiply(mixed $num): NumberInterface"
$num
: Accepts a mixed value that is limited to the formats detailed in the [Available Methods](#available-methods) section.

returns
: Returns an object of the same class as the calling class if the resulting value can be represented with a `SimpleNumberInterface`. Returns an object of the `ImmutableComplexNumber` class if the resulting value has both a real and imaginary component.

This function multiplies `$num` with the current value and returns the result.

Expand Down Expand Up @@ -266,8 +281,13 @@ This function multiplies `$num` with the current value and returns the result.
echo 'Circuit State: '.$newCircuitState;
// Prints: 'Circuit State: 24+80i'
```

###### divide(mixed $num, ?int $scale = null): NumberInterface

!!! signature "divide(mixed $num, ?int $scale = null): NumberInterface"
$num
: Accepts a mixed value that is limited to the formats detailed in the [Available Methods](#available-methods) section.

returns
: Returns an object of the same class as the calling class if the resulting value can be represented with a `SimpleNumberInterface`. Returns an object of the `ImmutableComplexNumber` class if the resulting value has both a real and imaginary component.

This function divides `$num` with the current value and returns the result.

Expand Down Expand Up @@ -350,8 +370,13 @@ This function divides `$num` with the current value and returns the result.
echo 'Circuit State: '.$newCircuitState;
// Prints: 'Circuit State: 1.5+5i'
```

###### pow(mixed $num): NumberInterface

!!! signature "pow(mixed $num): NumberInterface"
$num
: Accepts a mixed value that is limited to the formats detailed in the [Available Methods](#available-methods) section.

returns
: Returns an object of the same class as the calling class if the resulting value can be represented with a `SimpleNumberInterface`. Returns an object of the `ImmutableComplexNumber` class if the resulting value has both a real and imaginary component.

This function raises the current value to the power of `$num` and returns the result.

Expand Down
2 changes: 1 addition & 1 deletion docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ svg.fa-signature path {
background: inherit;
font-family: 'Source Code Pro';
font-weight: 500;
font-size: 12px;
font-size: 16px;
line-height: 16px;
border-bottom: 1px solid #000;
padding-bottom: 5px;
Expand Down

0 comments on commit 0461fc2

Please sign in to comment.