Skip to content

Improve float.fromhex module of objfloat#1552

Merged
windelbouwman merged 5 commits intoRustPython:masterfrom
Writtic:writtic/module_fromhex
Oct 31, 2019
Merged

Improve float.fromhex module of objfloat#1552
windelbouwman merged 5 commits intoRustPython:masterfrom
Writtic:writtic/module_fromhex

Conversation

@Writtic
Copy link
Copy Markdown
Contributor

@Writtic Writtic commented Oct 20, 2019

  • Python float.fromhex can handle string of float and hex without .
    • For example 0.0, -0.0, 0x0p0, -0x0p0
  • Add test case mantioned

johan.park added 2 commits October 20, 2019 21:17
- Python float.fromhex can handle string of float and hex without `.`
  - For example '0.0', '-0.0', '0x0p0', '-0x0p0'
- Add test case mantioned
@Writtic Writtic force-pushed the writtic/module_fromhex branch from e676fd0 to 8e3cab4 Compare October 20, 2019 12:40
- `expect` that can't express python vm error message changed to pattern match
- Erase duplicated test case
@Writtic Writtic force-pushed the writtic/module_fromhex branch from c94395f to 0d84b3f Compare October 20, 2019 14:04
@Writtic
Copy link
Copy Markdown
Contributor Author

Writtic commented Oct 21, 2019

This PR is needed to implement math.remainder() test case which use float.fromhash().

Check this link test_math.py#L1269

The link would help you understand this PR's purpose.

Comment thread vm/src/obj/objfloat.rs Outdated
Comment thread vm/src/obj/objfloat.rs Outdated
- Use `or_else` instead of value condition and `match` statement
  - For floating-point input
- Use `map_err` instead of `match ` statement
  - For hexadecimal floating-point input without dot
@Writtic Writtic force-pushed the writtic/module_fromhex branch from 50e0461 to bbb2ef4 Compare October 25, 2019 15:26
Comment thread vm/src/obj/objfloat.rs
@Writtic Writtic requested a review from windelbouwman October 31, 2019 12:22
@windelbouwman windelbouwman merged commit 40a22f2 into RustPython:master Oct 31, 2019
@Writtic Writtic deleted the writtic/module_fromhex branch November 1, 2019 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants