leanprover / leanprover/lean4

Feature request: even more float functions

Open
#1,485 0 comments 0 reactions 0 assignees View on GitHub

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 → Float seems 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 → Int and Float.exponent : Float → Int to return the mantissa and exponent parts of the float such that mantissa * 2^exponent is equal to the original float.
  • NaN ≠ NaN, so equality is not reflexive for Float which seems bad for Lean even if that is the correct behaviour in float spec.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.