mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tools: make v test-cleancode test everything by default (#10050)
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
module math
|
||||
|
||||
// f32_bits returns the IEEE 754 binary representation of f,
|
||||
// with the sign bit of f and the result in the same bit position.
|
||||
// f32_bits(f32_from_bits(x)) == x.
|
||||
pub fn f32_bits(f f32) u32 {
|
||||
p := *unsafe {&u32(&f)}
|
||||
p := *unsafe { &u32(&f) }
|
||||
return p
|
||||
}
|
||||
|
||||
@@ -15,7 +16,7 @@ pub fn f32_bits(f f32) u32 {
|
||||
// and the result in the same bit position.
|
||||
// f32_from_bits(f32_bits(x)) == x.
|
||||
pub fn f32_from_bits(b u32) f32 {
|
||||
p := *unsafe {&f32(&b)}
|
||||
p := *unsafe { &f32(&b) }
|
||||
return p
|
||||
}
|
||||
|
||||
@@ -23,7 +24,7 @@ pub fn f32_from_bits(b u32) f32 {
|
||||
// with the sign bit of f and the result in the same bit position,
|
||||
// and f64_bits(f64_from_bits(x)) == x.
|
||||
pub fn f64_bits(f f64) u64 {
|
||||
p := *unsafe {&u64(&f)}
|
||||
p := *unsafe { &u64(&f) }
|
||||
return p
|
||||
}
|
||||
|
||||
@@ -32,6 +33,6 @@ pub fn f64_bits(f f64) u64 {
|
||||
// and the result in the same bit position.
|
||||
// f64_from_bits(f64_bits(x)) == x.
|
||||
pub fn f64_from_bits(b u64) f64 {
|
||||
p := *unsafe {&f64(&b)}
|
||||
p := *unsafe { &f64(&b) }
|
||||
return p
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user