This repository was archived by the owner on Feb 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " malachite-bigint"
3
- version = " 0.2.1 "
3
+ version = " 0.2.2 "
4
4
authors = [" Steve Shi <shikangzhi@gmail.com>" ]
5
5
edition = " 2021"
6
6
license = " LGPL-3.0-only"
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ impl Neg for Sign {
79
79
From ,
80
80
Into ,
81
81
) ]
82
- #[ display( "{}" , " self.0" ) ]
82
+ #[ display( "{}" , self . 0 ) ]
83
83
#[ into( owned, ref, ref_mut) ]
84
84
pub struct BigInt ( Integer ) ;
85
85
@@ -680,3 +680,9 @@ fn test_to_signed_bytes() {
680
680
let i2 = BigInt :: from_signed_bytes_le ( & b) ;
681
681
assert_eq ! ( i, i2) ;
682
682
}
683
+
684
+ #[ test]
685
+ fn test_display_bigint ( ) {
686
+ let n = BigInt :: from_str ( "1234567890" ) . unwrap ( ) ;
687
+ assert_eq ! ( format!( "{}" , n) , "1234567890" ) ;
688
+ }
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl_primitive_convert!(BigUint, f64);
54
54
From ,
55
55
Into ,
56
56
) ]
57
- #[ display( "{}" , " self.0" ) ]
57
+ #[ display( "{}" , self . 0 ) ]
58
58
#[ into( owned, ref, ref_mut) ]
59
59
pub struct BigUint ( pub ( crate ) Natural ) ;
60
60
@@ -487,3 +487,9 @@ impl BigUint {
487
487
fn test_from_string_base ( ) {
488
488
assert ! ( BigUint :: from_str_radix( "1000000000000000111111100112abcdefg" , 16 ) . is_err( ) ) ;
489
489
}
490
+
491
+ #[ test]
492
+ fn test_display_biguint ( ) {
493
+ let x = BigUint :: from_str_radix ( "1234567890" , 10 ) . unwrap ( ) ;
494
+ assert_eq ! ( format!( "{}" , x) , "1234567890" ) ;
495
+ }
You can’t perform that action at this time.
0 commit comments