Created
November 14, 2011 21:55
-
-
Save jnthn/1365326 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $knowhow := pir::get_knowhow__P(); | |
my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); | |
$bi_type.HOW.compose($bi_type); | |
sub str($x) { pir::nqp_bigint_to_str__SP($x) }; | |
my $float := 123456789e240; | |
say($float); | |
say(str(nqp::fromnum_I($float, $bi_type))); | |
say(nqp::tonum_I(nqp::fromnum_I($float, $bi_type))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.23456789e+248 | |
123456788999986831256086247028260837404218218866805099569198413237038405179144671342780018654965011100898948862467045461038125012276636029689988402417542284055506720527760368106755663981427477197667179329065318736081832508978884302520094994515099648 | |
1.23456788999987e+248 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output on linux/amd64
1.23456789e+248
123456789000000021449798433851373863133952196288514562072799836691446642565259740671674042112991278243860357042943712804798127837874595663434043201880611994720195470402719049156231937122225032251533905389452554170522982324097391888146965015742644224
1.23456789e+248