Skip to content

0.2.4

  • 0.2.4
  • 22d7160
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
  • Compare
    Choose a tag to compare
  • 0.2.4
  • 22d7160
  • Compare
    Choose a tag to compare
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@dnovaes dnovaes tagged this 09 Oct 16:26
# Description 🗒️ 

This PRs converts integers to floats inside the `default_value()` evaluation, fixing the `default_value()` numbers incompatibility issue.

### Changes:

- [x] Update version to `0.2.4` for release 

last version published on jitpack `0.2.3`:
![DeepinScreenshot_select-area_20201009130255](https://user-images.githubusercontent.com/3251916/95605834-e401dc80-0a2f-11eb-9cd3-aecf28947e3e.png)

- [x] Fix issue associated with result of different types of number parameters

Now, this function is much more flexible to play with **integer** and **float** parameters.

For example...

```rb
parsec> default_value(1, 10)
Result (type: 'i'):
ans = 1

parsec> default_value(1, 10.0)
Result (type: 'i'):
ans = 1

parsec> default_value(1.0, 10)
Result (type: 'i'):
ans = 1

parsec> default_value(1.0, 10.0)
Result (type: 'i'):
ans = 1

parsec> default_value(1.5, 10)
Result (type: 'f'):
ans = 1.5

parsec> default_value(1.5, 10.0)
Result (type: 'f'):
ans = 1.5

parsec> default_value(1.5, 10.5)
Result (type: 'f'):
ans = 1.5
```

# The Bug 🐛 

![SLA error reason](https://user-images.githubusercontent.com/7637806/95136053-c97fe880-073b-11eb-8b88-a21901fba20c.png)

Reference: https://github.com/niltonvasques/equations-parser/pull/31
Assets 2
Loading