Skip to content

Commit

Permalink
Fix floating point errors
Browse files Browse the repository at this point in the history
* swh - dyson_compress_1403, fix NaN
* swh - shaper_1187, division with 0
  • Loading branch information
tresf committed Nov 8, 2017
1 parent 5edf95c commit a9dfd52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dyson_compress_1403.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
<port label="release_time" dir="input" type="control" hint="default_low">
<name>Release time (s)</name>
<p>Controls the time taken for the compressor to relax its gain control over the input signal.</p>
<range min="0" max="1"/>
<range min="0.0000001" max="1"/>
</port>

<port label="cfrate" dir="input" type="control" hint="default_middle">
Expand Down
4 changes: 2 additions & 2 deletions shaper_1187.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ float shape = 0.0f;
if (shapep < 1.0f && shapep > -1.0f) {
shape = 1.0f;
} else if (shape < 0) {
shape = -1.0f / shape;
} else if (shapep < 0) {
shape = -1.0f / shapep;
} else {
shape = shapep;
}
Expand Down

0 comments on commit a9dfd52

Please sign in to comment.