-
Notifications
You must be signed in to change notification settings - Fork 24
ACP: More float constants #661
Copy link
Copy link
Open
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal
Implement more float constants, namely: sqrt(5), 1/sqrt(5), ln(3)
Problem statement
The need for using floating point representations of the numerical constants.
Motivating examples or use cases
Constant time generation of Fibonacci numbers
Generates all Fibonacci numbers that fit in
u64Solution sketch
In
core/src/num/f32.rs:Basically the same in
f64.rs,f16.rs,f128.rsAlternatives
Links and related work
rust-lang/rust#146934
rust-lang/rust#146939
rust-lang/rust#103883
rust-lang/rust#125253
rust-lang/rust#116909
#383
#119