1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-26 00:25:20 +00:00

Change ceiling and floor to return NumberInterface. Add fractional part function. Add intValue function. Change StandardPlugin correspondingly.

This commit is contained in:
Arthur Drobot
2017-08-02 12:00:56 -07:00
parent 52fbfd5134
commit 601c4fea55
4 changed files with 60 additions and 12 deletions

View File

@@ -83,13 +83,26 @@ public interface NumberInterface {
* Returns the least integer greater than or equal to the number.
* @return the least integer >= the number, if int can hold the value.
*/
int ceiling();
NumberInterface ceiling();
/**
* Return the greatest integer less than or equal to the number.
* @return the greatest int >= the number, if int can hold the value.
*/
int floor();
NumberInterface floor();
/**
* Returns the fractional part of the number.
* @return the fractional part of the number.
*/
NumberInterface fractionalPart();
/**
* Returns the integer representation of this number, discarding any fractional part,
* if int can hold the value.
* @return
*/
int intValue();
/**
* Promotes this class to another number class.