Skip to content

Commit 3da057e

Browse files
authored
fix bug in zshape and sshape FMs code generation (#39)
1 parent 36ebf5f commit 3da057e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "FuzzyLogic"
22
uuid = "271df9f8-4390-4196-9d4f-bdd0b67035b3"
33
authors = ["Luca Ferranti"]
4-
version = "0.1.2"
4+
version = "0.1.3"
55

66
[deps]
77
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"

docs/src/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44

55
## Unreleased
66

7+
- ![](https://img.shields.io/badge/bugfix-purple.svg) fix bug in Julia code generation of ZShape and SShape mf
78
- ![](https://img.shields.io/badge/bugfix-purple.svg) disallow implicit conversion from interval to float
89
- ![](https://img.shields.io/badge/new%20feature-green.svg) added semi-elliptic and singleton membership functions
910
- ![](https://img.shields.io/badge/new%20feature-green.svg) added `gensurf` to plot generating surface

src/tojulia.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ end
160160

161161
function to_expr(s::SShapeMF, x = :x)
162162
:(if $x <= $(s.a)
163-
zero(float($(typeof(x))))
163+
zero(float(typeof($x)))
164164
elseif $x >= $(s.b)
165165
one(float(typeof($x)))
166166
elseif $x >= $((s.a + s.b) / 2)
@@ -172,7 +172,7 @@ end
172172

173173
function to_expr(mf::ZShapeMF, x = :x)
174174
:(if $x <= $(mf.a)
175-
one(float($(typeof(x))))
175+
one(float(typeof($x)))
176176
elseif $x >= $(mf.b)
177177
zero(float(typeof($x)))
178178
elseif $x >= $((mf.a + mf.b) / 2)

0 commit comments

Comments
 (0)