Browse Source

add log expr to function expressions

Morgan Chen 5 tháng trước cách đây
mục cha
commit
88b2484346
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      Firestore/Swift/Source/ExpressionImplementation.swift

+ 8 - 0
Firestore/Swift/Source/ExpressionImplementation.swift

@@ -379,6 +379,14 @@ public extension Expression {
     return FunctionExpression("ln", [self])
   }
 
+  func log(_ base: Sendable) -> FunctionExpression {
+    return FunctionExpression("log", [self, Helper.sendableToExpr(base)])
+  }
+
+  func log(_ base: Expression) -> FunctionExpression {
+    return FunctionExpression("log", [self, base])
+  }
+
   func pow(_ exponent: Sendable) -> FunctionExpression {
     return FunctionExpression("pow", [self, Helper.sendableToExpr(exponent)])
   }