Feature request: even more float functions
Open
Nobody has claimed this yet.
feature
P-medium
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
I have more requests:
-
Float.abs : Float → Floatseems to be missing -
Float.toInt : Float → Int, where it returns a best-effort GMP integer if the float value wouldn't fit in to a scalar value. -
Float.mantissa: Float → IntandFloat.exponent : Float → Intto return the mantissa and exponent parts of the float such thatmantissa * 2^exponentis equal to the original float. -
NaN ≠ NaN, so equality is not reflexive forFloatwhich seems bad for Lean even if that is the correct behaviour in float spec.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue lists four Float-related requests: toInt, mantissa, exponent, and NaN equality behavior; Float.abs is already marked complete. Start by checking the existing Float API and its equality semantics, then determine how each unchecked behavior is specified and tested. Done means the requested functions and equality behavior are implemented consistently with Lean's float model.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100