-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement all stable and safe std f32/f64-methods on FF32 and FF64 #1
base: master
Are you sure you want to change the base?
Conversation
All these method calls are delegated to the corresponding methods on the underlying primitive types (`f32` or `f64`). For all methods returning floats, these are getting converted to `Fast<_>`. Of course all of this only works when using std, so I added a feature gate called "std". Other changes: - added .gitignore file to ignore target directory - added #[inline(always)] annotations to `get`, `into` and operator methods
If we're going to have some feature development and make this crate something more serious than just an experiment, then we also need to address the top issue of making the FF64/FF32 constructors |
On further thought, there are (after the unsafe question) some methods here that I'd prefer to not implement. For example |
That makes a lot of sense. I was mostly going for a quick drop-in replacement for normal float types that uses the flag whenever possible. By now I figured out that it makes more sense to properly implement |
With nightly rust on LLVM 11 now (soon to be 12), the (Note that I don't think just making the constructors
+1 to this. Probably shouldn't offer a "fast" I think |
I also notice that impl_assignop is completely broken (uses |
All these method calls are delegated to the corresponding methods
on the underlying primitive types (
f32
orf64
). For all methodsreturning floats, these are getting converted to
Fast<_>
.Of course all of this only works when using std, so I added a
feature gate called "std".
Other minor changes:
get
,into
and operatormethods
cargo fmt