Skip to content

Commit ab8bc27

Browse files
author
MarkBaker
committed
Updates to the README document
1 parent 10e4e6d commit ab8bc27

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PHPComplex
33

44
---
55

6-
PHP Class for handling Complex numbers
6+
PHP Class Library for working with Complex numbers
77

88
[![Build Status](https://github.com/MarkBaker/PHPComplex/workflows/main/badge.svg)](https://github.com/MarkBaker/PHPComplex/actions)
99
[![Total Downloads](https://img.shields.io/packagist/dt/markbaker/complex)](https://packagist.org/packages/markbaker/complex)
@@ -65,6 +65,24 @@ together with functions for
6565

6666
---
6767

68+
# Installation
69+
70+
```shell
71+
composer require markbaker/complex:^3.0
72+
```
73+
74+
# Important BC Note
75+
76+
If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use [MarkBaker/PHPComplexFunctions](https://github.com/MarkBaker/PHPComplexFunctions) instead (available on packagist as [markbaker/complex-functions](https://packagist.org/packages/markbaker/complex-functions)).
77+
78+
You'll need to replace `markbaker/complex`in your `composer.json` file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Complex functions in the past, so no actual code changes are required.
79+
80+
```shell
81+
composer require markbaker/complex-functions:^1.0
82+
```
83+
84+
You should not reference this library (`markbaker/complex`) in your `composer.json`, composer wil take care of that for you.
85+
6886
# Usage
6987

7088
To create a new complex object, you can provide either the real, imaginary and suffix parts as individual values, or as an array of values passed passed to the constructor; or a string representing the value. e.g
@@ -117,7 +135,7 @@ echo Complex\Operations::add($complexString1, $complexString2);
117135
```
118136
If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
119137

120-
You can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
138+
You can pass these arguments as Complex objects, or as an array, or string that will parse to a complex object.
121139

122140
## Using functions
123141

@@ -135,6 +153,8 @@ $complexString = '1.23-4.56i';
135153

136154
echo Complex\Functions::sinh($complexString);
137155
```
156+
As with operations, you can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
157+
138158

139159
In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function
140160

0 commit comments

Comments
 (0)