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

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Negate decimal

Negate decimal methods that convert positive decimals into negative decimals and vice versa.

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

NegateDecimal negateDecimal = new NegateDecimal(); // One way of getting the negateDecimal class.

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