Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 1.65 KB

README.md

File metadata and controls

67 lines (46 loc) · 1.65 KB

Negate decimal

Converting positive decimals into negative decimals and vice versa.

The negateDecimal class can be accessed in the src folder or by clicking here.

Important

The negateDecimal class must be inside your project before any methods can be used.

// One way of getting the negateDecimal class inside your project. This requires the class to be in the same folder as the file using this code.
NegateDecimal negateDecimal = new NegateDecimal();

Negate decimal methods

negateDecimal.negateDouble(double decimalDouble) | Returns a double

Returns a negative version of a positive double and vice versa.

negateDecimal.negateDouble(6.0); // Returns -6.0 as a double.
negateDecimal.negateDouble(156.415); // Returns -156.415 as a double.
negateDecimal.negateDouble(0.0); // Returns 0.0 as a double.
negateDecimal.negateDouble(-9.0); // Returns 9.0 as a double.
negateDecimal.negateDouble(-16.5); // Returns 16.5 as a double.

negateDecimal.negateFloat(float decimalFloat) | Returns a float

Returns a negative version of a positve float and vice versa.

negateDecimal.negateFloat(6.0f); // Returns -6.0 as a float.
negateDecimal.negateFloat(156.415f); // Returns -156.415 as a float.
negateDecimal.negateFloat(0.0f); // Returns 0.0 as a float.
negateDecimal.negateFloat(-9.0f); // Returns 9.0 as a float.
negateDecimal.negateFloat(-16.5f); // Returns 16.5 as a float.

License

This repository contains the MIT license. You must give credit if you are going to use its source code.