8000 GitHub - kamirr/atomic_float: Floating point types which can be safely shared between threads
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Floating point types which can be safely shared between threads

License

Notifications You must be signed in to change notification settings

kamirr/atomic_float

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atomic_float

Build Status codecov Docs Latest Version

This crate provides AtomicF32 and AtomicF64 types that behave almost identically to the integer atomics in the stdlib.

Usage

use atomic_float::AtomicF32;
use core::sync::atomic::Ordering::Relaxed;

static A_STATIC: AtomicF32 = AtomicF32::new(800.0);

// Should support the full std::sync::atomic::AtomicFoo API
A_STATIC.fetch_add(30.0, Relaxed);
A_STATIC.fetch_sub(-55.0, Relaxed);
// But also supports things that can be implemented
// efficiently easily, like sign-bit operations.
A_STATIC.fetch_neg(Relaxed);

assert_eq!(A_STATIC.load(Relaxed), -885.0);

License

Licensed under either of

at your option.

About

Floating point types which can be safely shared between threads

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0