Skip to content

Commit

Permalink
Fixed 0 / 0 problem
Browse files Browse the repository at this point in the history
  • Loading branch information
arguiot committed Aug 24, 2020
1 parent 72d245c commit 090f773
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Euler.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Euler"
s.version = "0.2.5"
s.version = "0.2.6"
s.summary = "The open source computational framework for the Swift language (early stage)"
s.description = <<-DESC
The open source computational framework for the Swift language (early stage)
Expand Down
4 changes: 2 additions & 2 deletions Euler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Euler.xcodeproj/Euler_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MARKETING_VERSION = 0.2.5;
MARKETING_VERSION = 0.2.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand All @@ -843,7 +843,7 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Euler.xcodeproj/Euler_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MARKETING_VERSION = 0.2.5;
MARKETING_VERSION = 0.2.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ I’m already working with Apple to fix this, but if you have the solution, plea
[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Euler into your Xcode project using CocoaPods, specify it in your `Podfile`:

```ruby
pod 'Euler', '~> 0.2.5'
pod 'Euler', '~> 0.2.6'
```

### Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Euler into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "arguiot/Euler" ~> 0.2.5
github "arguiot/Euler" ~> 0.2.6
```

### Swift Package Manager
Expand All @@ -34,7 +34,7 @@ Once you have your Swift package set up, adding Euler as a dependency is as easy

```swift
dependencies: [
.package(url: "https://github.com/arguiot/Euler.git", .upToNextMajor(from: "0.2.5"))
.package(url: "https://github.com/arguiot/Euler.git", .upToNextMajor(from: "0.2.6"))
]
```

Expand Down
1 change: 1 addition & 0 deletions Sources/Euler/Algebra/Parser/Node/OperatorNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class OperatorNode: NSObject, Node {
case "-":
return NullNode()
case "/":
guard 0 != (try? c2.evaluate([:], Tables.functions).number) else { return self }
return ConstantNode(1)
case "*":
return OperatorNode("^", children: [c1, ConstantNode(2)])
Expand Down
1 change: 1 addition & 0 deletions Tests/EulerTests/NodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class NodeTests: XCTestCase {
XCTAssertEqual(comp.toString(), "x + y * 2 + 3")

XCTAssertEqual(try Parser("(4*2)").parse().compile().toString(), "8")
XCTAssertEqual(try Parser("0 / 0").parse().compile().toString(), "0 / 0")
XCTAssertEqual(try Parser("x+x - y*y").parse().compile().toString(), "2 * x - y ^ 2")
} catch {
print(error.localizedDescription)
Expand Down

0 comments on commit 090f773

Please sign in to comment.