@@ -378,6 +378,29 @@ public function isThirteen(): bool
378378 return $ this ->isEqual ('13 ' );
379379 }
380380
381+ /**
382+ * Returns boolean if the current value is equal to the given value.
383+ *
384+ * @param AbstractNumber|string|float|int $value
385+ */
386+ public function isEqual ($ value , int $ scale = null ): bool
387+ {
388+ $ number = $ this ->getNumberFromInput ($ value );
389+ $ scale = $ scale ?? self ::INTERNAL_SCALE ;
390+
391+ return bccomp ($ this ->value , $ number ->get (), $ scale ) === 0 ;
392+ }
393+
394+ /**
395+ * Alias for isEqual method.
396+ *
397+ * @param AbstractNumber|string|float|int $value
398+ */
399+ public function eq ($ value , int $ scale = null ): bool
400+ {
401+ return $ this ->isEqual ($ value , $ scale );
402+ }
403+
381404 /**
382405 * Returns boolean if the current value is greater than the given value.
383406 *
@@ -391,6 +414,36 @@ public function isGreaterThan($value, int $scale = null): bool
391414 return bccomp ($ this ->value , $ number ->get (), $ scale ) === 1 ;
392415 }
393416
417+ /**
418+ * Alias for isGreaterThan method.
419+ *
420+ * @param AbstractNumber|string|float|int $value
421+ */
422+ public function gt ($ value , int $ scale = null ): bool
423+ {
424+ return $ this ->isGreaterThan ($ value , $ scale );
425+ }
426+
427+ /**
428+ * Returns boolean if the current value is greater than or equal to the given value.
429+ *
430+ * @param AbstractNumber|string|float|int $value
431+ */
432+ public function isGreaterThanOrEqual ($ value , int $ scale = null ): bool
433+ {
434+ return $ this ->isGreaterThan ($ value , $ scale ) || $ this ->isEqual ($ value , $ scale );
435+ }
436+
437+ /**
438+ * Alias for isGreaterThanOrEqual method.
439+ *
440+ * @param AbstractNumber|string|float|int $value
441+ */
442+ public function gte ($ value , int $ scale = null ): bool
443+ {
444+ return $ this ->isGreaterThanOrEqual ($ value , $ scale );
445+ }
446+
394447 /**
395448 * Returns boolean if the current value is less than the given value.
396449 *
@@ -405,16 +458,33 @@ public function isLessThan($value, int $scale = null): bool
405458 }
406459
407460 /**
408- * Returns boolean if the current value is equal to the given value .
461+ * Alias for isLessThan method .
409462 *
410463 * @param AbstractNumber|string|float|int $value
411464 */
412- public function isEqual ($ value , int $ scale = null ): bool
465+ public function lt ($ value , int $ scale = null ): bool
413466 {
414- $ number = $ this ->getNumberFromInput ($ value );
415- $ scale = $ scale ?? self :: INTERNAL_SCALE ;
467+ return $ this ->isLessThan ($ value, $ scale );
468+ }
416469
417- return bccomp ($ this ->value , $ number ->get (), $ scale ) === 0 ;
470+ /**
471+ * Returns boolean if the current value is less than or equal to the given value.
472+ *
473+ * @param AbstractNumber|string|float|int $value
474+ */
475+ public function isLessThanOrEqual ($ value , int $ scale = null ): bool
476+ {
477+ return $ this ->isLessThan ($ value , $ scale ) || $ this ->isEqual ($ value , $ scale );
478+ }
479+
480+ /**
481+ * Alias for isGreaterThanOrEqual method.
482+ *
483+ * @param AbstractNumber|string|float|int $value
484+ */
485+ public function lte ($ value , int $ scale = null ): bool
486+ {
487+ return $ this ->isLessThanOrEqual ($ value , $ scale );
418488 }
419489
420490 /**
0 commit comments