You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of the time, needed precision might be known ahead of runtime. Const generics might be able to make use of something like this:
structKnownBigFloat<constWORDS:usize = 2>{inner:KnownFlavor<WORDS>,}#[derive(Debug)]enumKnownFlavor<constWORDS:usize>{Value(KnownBigFloatNumber<WORDS>),NaN(Option<Error>),Inf(Sign),// signed Inf}pub(crate)structKnownBigFloatNumber<constWORDS:usize>{e:Exponent,s:Sign,m:KnownMantissa<WORDS>,inexact:bool,}pub(crate)structKnownMantissa<constWORDS:usize>{m:[Word;WORDS],}
I expect this would have a noticeable performance increase as well - mantissa is smaller for <= 128 bits of precision, allocation-free, no indirection, and probably some nicer optimizations.
A downside is this isn't as elegant as it could be with the unstbale generic_const_exprs - ideally you could specify BITS in the const generic and store m: [Word; BITS / WORD_BIT_SIZE], but that won't be stable for a while.
The text was updated successfully, but these errors were encountered:
A lot of the time, needed precision might be known ahead of runtime. Const generics might be able to make use of something like this:
I expect this would have a noticeable performance increase as well - mantissa is smaller for <= 128 bits of precision, allocation-free, no indirection, and probably some nicer optimizations.
A downside is this isn't as elegant as it could be with the unstbale
generic_const_exprs
- ideally you could specifyBITS
in the const generic and storem: [Word; BITS / WORD_BIT_SIZE]
, but that won't be stable for a while.The text was updated successfully, but these errors were encountered: