summaryrefslogtreecommitdiffstats
path: root/src/etc/test-float-parse/src/bin/subnorm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/test-float-parse/src/bin/subnorm.rs')
-rw-r--r--src/etc/test-float-parse/src/bin/subnorm.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/etc/test-float-parse/src/bin/subnorm.rs b/src/etc/test-float-parse/src/bin/subnorm.rs
new file mode 100644
index 000000000..ac88747ea
--- /dev/null
+++ b/src/etc/test-float-parse/src/bin/subnorm.rs
@@ -0,0 +1,11 @@
+use std::mem::transmute;
+use test_float_parse::validate;
+
+fn main() {
+ for bits in 0u32..(1 << 21) {
+ let single: f32 = unsafe { transmute(bits) };
+ validate(&format!("{:e}", single));
+ let double: f64 = unsafe { transmute(bits as u64) };
+ validate(&format!("{:e}", double));
+ }
+}