Skip to content

Converting positive decimals into negative decimals and vice versa

License

Notifications You must be signed in to change notification settings

Synthird/Negate-decimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Converting positive decimals into negative decimals and vice versa

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages