@@ -570,51 +570,175 @@ abstract class Expr internal constructor() {
570
570
fun bitRightShift (bitsFieldName : String , number : Int ): Expr =
571
571
FunctionExpr (" bit_right_shift" , bitsFieldName, number)
572
572
573
+ /* *
574
+ * Creates an expression that rounds [numericExpr] to nearest integer.
575
+ *
576
+ * Rounds away from zero in halfway cases.
577
+ *
578
+ * @param numericExpr An expression that returns number when evaluated.
579
+ * @return A new [Expr] representing an integer result from the round operation.
580
+ */
581
+ @JvmStatic fun round (numericExpr : Expr ): Expr = FunctionExpr (" round" , numericExpr)
582
+
583
+ /* *
584
+ * Creates an expression that rounds [numericField] to nearest integer.
585
+ *
586
+ * Rounds away from zero in halfway cases.
587
+ *
588
+ * @param numericField Name of field that returns number when evaluated.
589
+ * @return A new [Expr] representing an integer result from the round operation.
590
+ */
591
+ @JvmStatic fun round (numericField : String ): Expr = FunctionExpr (" round" , numericField)
592
+
593
+ /* *
594
+ * Creates an expression that rounds off [numericExpr] to [decimalPlace] decimal places if
595
+ * [decimalPlace] is positive, rounds off digits to the left of the decimal point if
596
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
597
+ *
598
+ * @param numericExpr An expression that returns number when evaluated.
599
+ * @param decimalPlace The number of decimal places to round.
600
+ * @return A new [Expr] representing the round operation.
601
+ */
573
602
@JvmStatic
574
603
fun round (numericExpr : Expr , decimalPlace : Int ): Expr =
575
604
FunctionExpr (" round" , numericExpr, constant(decimalPlace))
576
605
606
+ /* *
607
+ * Creates an expression that rounds off [numericField] to [decimalPlace] decimal places if
608
+ * [decimalPlace] is positive, rounds off digits to the left of the decimal point if
609
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
610
+ *
611
+ * @param numericField Name of field that returns number when evaluated.
612
+ * @param decimalPlace The number of decimal places to round.
613
+ * @return A new [Expr] representing the round operation.
614
+ */
577
615
@JvmStatic
578
616
fun round (numericField : String , decimalPlace : Int ): Expr =
579
617
FunctionExpr (" round" , numericField, constant(decimalPlace))
580
618
581
- @JvmStatic fun round (numericExpr : Expr ): Expr = FunctionExpr (" round" , numericExpr)
582
-
583
- @JvmStatic fun round (numericField : String ): Expr = FunctionExpr (" round" , numericField)
584
-
619
+ /* *
620
+ * Creates an expression that rounds off [numericExpr] to [decimalPlace] decimal places if
621
+ * [decimalPlace] is positive, rounds off digits to the left of the decimal point if
622
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
623
+ *
624
+ * @param numericExpr An expression that returns number when evaluated.
625
+ * @param decimalPlace The number of decimal places to round.
626
+ * @return A new [Expr] representing the round operation.
627
+ */
585
628
@JvmStatic
586
629
fun round (numericExpr : Expr , decimalPlace : Expr ): Expr =
587
630
FunctionExpr (" round" , numericExpr, decimalPlace)
588
631
632
+ /* *
633
+ * Creates an expression that rounds off [numericField] to [decimalPlace] decimal places if
634
+ * [decimalPlace] is positive, rounds off digits to the left of the decimal point if
635
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
636
+ *
637
+ * @param numericField Name of field that returns number when evaluated.
638
+ * @param decimalPlace The number of decimal places to round.
639
+ * @return A new [Expr] representing the round operation.
640
+ */
589
641
@JvmStatic
590
642
fun round (numericField : String , decimalPlace : Expr ): Expr =
591
643
FunctionExpr (" round" , numericField, decimalPlace)
592
644
645
+ /* *
646
+ * Creates an expression that returns the smalled integer that isn't less than [numericExpr].
647
+ *
648
+ * @param numericExpr An expression that returns number when evaluated.
649
+ * @return A new [Expr] representing an integer result from the ceil operation.
650
+ */
593
651
@JvmStatic fun ceil (numericExpr : Expr ): Expr = FunctionExpr (" ceil" , numericExpr)
594
652
653
+ /* *
654
+ * Creates an expression that returns the smalled integer that isn't less than [numericField].
655
+ *
656
+ * @param numericField Name of field that returns number when evaluated.
657
+ * @return A new [Expr] representing an integer result from the ceil operation.
658
+ */
595
659
@JvmStatic fun ceil (numericField : String ): Expr = FunctionExpr (" ceil" , numericField)
596
660
661
+ /* *
662
+ * Creates an expression that returns the largest integer that isn't less than [numericExpr].
663
+ *
664
+ * @param numericExpr An expression that returns number when evaluated.
665
+ * @return A new [Expr] representing an integer result from the floor operation.
666
+ */
597
667
@JvmStatic fun floor (numericExpr : Expr ): Expr = FunctionExpr (" floor" , numericExpr)
598
668
669
+ /* *
670
+ * Creates an expression that returns the largest integer that isn't less than [numericField].
671
+ *
672
+ * @param numericField Name of field that returns number when evaluated.
673
+ * @return A new [Expr] representing an integer result from the floor operation.
674
+ */
599
675
@JvmStatic fun floor (numericField : String ): Expr = FunctionExpr (" floor" , numericField)
600
676
677
+ /* *
678
+ * Creates an expression that returns the [numericExpr] raised to the power of the [exponent].
679
+ * Returns infinity on overflow and zero on underflow.
680
+ *
681
+ * @param numericExpr An expression that returns number when evaluated.
682
+ * @param exponent The numeric power to raise the [numericExpr].
683
+ * @return A new [Expr] representing a numeric result from raising [numericExpr] to the power of
684
+ * [exponent].
685
+ */
601
686
@JvmStatic
602
687
fun pow (numericExpr : Expr , exponent : Number ): Expr =
603
688
FunctionExpr (" pow" , numericExpr, constant(exponent))
604
689
690
+ /* *
691
+ * Creates an expression that returns the [numericField] raised to the power of the [exponent].
692
+ * Returns infinity on overflow and zero on underflow.
693
+ *
694
+ * @param numericField Name of field that returns number when evaluated.
695
+ * @param exponent The numeric power to raise the [numericField].
696
+ * @return A new [Expr] representing a numeric result from raising [numericField] to the power
697
+ * of [exponent].
698
+ */
605
699
@JvmStatic
606
700
fun pow (numericField : String , exponent : Number ): Expr =
607
701
FunctionExpr (" pow" , numericField, constant(exponent))
608
702
703
+ /* *
704
+ * Creates an expression that returns the [numericExpr] raised to the power of the [exponent].
705
+ * Returns infinity on overflow and zero on underflow.
706
+ *
707
+ * @param numericExpr An expression that returns number when evaluated.
708
+ * @param exponent The numeric power to raise the [numericExpr].
709
+ * @return A new [Expr] representing a numeric result from raising [numericExpr] to the power of
710
+ * [exponent].
711
+ */
609
712
@JvmStatic
610
713
fun pow (numericExpr : Expr , exponent : Expr ): Expr = FunctionExpr (" pow" , numericExpr, exponent)
611
714
715
+ /* *
716
+ * Creates an expression that returns the [numericField] raised to the power of the [exponent].
717
+ * Returns infinity on overflow and zero on underflow.
718
+ *
719
+ * @param numericField Name of field that returns number when evaluated.
720
+ * @param exponent The numeric power to raise the [numericField].
721
+ * @return A new [Expr] representing a numeric result from raising [numericField] to the power
722
+ * of [exponent].
723
+ */
612
724
@JvmStatic
613
725
fun pow (numericField : String , exponent : Expr ): Expr =
614
726
FunctionExpr (" pow" , numericField, exponent)
615
727
728
+ /* *
729
+ * Creates an expression that returns the square root of [numericExpr].
730
+ *
731
+ * @param numericExpr An expression that returns number when evaluated.
732
+ * @return A new [Expr] representing the numeric result of the square root operation.
733
+ */
616
734
@JvmStatic fun sqrt (numericExpr : Expr ): Expr = FunctionExpr (" sqrt" , numericExpr)
617
735
736
+ /* *
737
+ * Creates an expression that returns the square root of [numericField].
738
+ *
739
+ * @param numericField Name of field that returns number when evaluated.
740
+ * @return A new [Expr] representing the numeric result of the square root operation.
741
+ */
618
742
@JvmStatic fun sqrt (numericField : String ): Expr = FunctionExpr (" sqrt" , numericField)
619
743
620
744
/* *
@@ -2429,20 +2553,76 @@ abstract class Expr internal constructor() {
2429
2553
*/
2430
2554
fun mod (other : Any ) = Companion .mod(this , other)
2431
2555
2556
+ /* *
2557
+ * Creates an expression that rounds this numeric expression to nearest integer.
2558
+ *
2559
+ * Rounds away from zero in halfway cases.
2560
+ *
2561
+ * @return A new [Expr] representing an integer result from the round operation.
2562
+ */
2432
2563
fun round () = Companion .round(this )
2433
2564
2565
+ /* *
2566
+ * Creates an expression that rounds off this numeric expression to [decimalPlace] decimal places
2567
+ * if [decimalPlace] is positive, rounds off digits to the left of the decimal point if
2568
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
2569
+ *
2570
+ * @param decimalPlace The number of decimal places to round.
2571
+ * @return A new [Expr] representing the round operation.
2572
+ */
2434
2573
fun round (decimalPlace : Int ) = Companion .round(this , decimalPlace)
2435
2574
2575
+ /* *
2576
+ * Creates an expression that rounds off this numeric expression to [decimalPlace] decimal places
2577
+ * if [decimalPlace] is positive, rounds off digits to the left of the decimal point if
2578
+ * [decimalPlace] is negative. Rounds away from zero in halfway cases.
2579
+ *
2580
+ * @param decimalPlace The number of decimal places to round.
2581
+ * @return A new [Expr] representing the round operation.
2582
+ */
2436
2583
fun round (decimalPlace : Expr ) = Companion .round(this , decimalPlace)
2437
2584
2585
+ /* *
2586
+ * Creates an expression that returns the smalled integer that isn't less than this numeric
2587
+ * expression.
2588
+ *
2589
+ * @return A new [Expr] representing an integer result from the ceil operation.
2590
+ */
2438
2591
fun ceil () = Companion .ceil(this )
2439
2592
2593
+ /* *
2594
+ * Creates an expression that returns the largest integer that isn't less than this numeric
2595
+ * expression.
2596
+ *
2597
+ * @return A new [Expr] representing an integer result from the floor operation.
2598
+ */
2440
2599
fun floor () = Companion .floor(this )
2441
2600
2442
- fun pow (exponentExpr : Number ) = Companion .pow(this , exponentExpr)
2601
+ /* *
2602
+ * Creates an expression that returns this numeric expression raised to the power of the
2603
+ * [exponent]. Returns infinity on overflow and zero on underflow.
2604
+ *
2605
+ * @param exponent The numeric power to raise this numeric expression.
2606
+ * @return A new [Expr] representing a numeric result from raising this numeric expression to the
2607
+ * power of [exponent].
2608
+ */
2609
+ fun pow (exponent : Number ) = Companion .pow(this , exponent)
2443
2610
2444
- fun pow (exponentExpr : Expr ) = Companion .pow(this , exponentExpr)
2611
+ /* *
2612
+ * Creates an expression that returns this numeric expression raised to the power of the
2613
+ * [exponent]. Returns infinity on overflow and zero on underflow.
2614
+ *
2615
+ * @param exponent The numeric power to raise this numeric expression.
2616
+ * @return A new [Expr] representing a numeric result from raising this numeric expression to the
2617
+ * power of [exponent].
2618
+ */
2619
+ fun pow (exponent : Expr ) = Companion .pow(this , exponent)
2445
2620
2621
+ /* *
2622
+ * Creates an expression that returns the square root of this numeric expression.
2623
+ *
2624
+ * @return A new [Expr] representing the numeric result of the square root operation.
2625
+ */
2446
2626
fun sqrt () = Companion .sqrt(this )
2447
2627
2448
2628
/* *
0 commit comments