# YAML's handling of Bignum's in 1.8.4

**URL:** <https://www.ruby-forum.com/t/yamls-handling-of-bignums-in-1-8-4/71126>\
**Category:** Ruby\
**Created:** [February 21, 2006, 2:33am UTC](https://www.ruby-forum.com/t/yamls-handling-of-bignums-in-1-8-4/71126 "2006-02-21T02:33:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@Ron\_M](https://www.ruby-forum.com/u/Ron_M)\
**Post date:** [February 21, 2006, 2:33am UTC](https://www.ruby-forum.com/t/yamls-handling-of-bignums-in-1-8-4/71126/1 "2006-02-21T02:33:46Z")

</div>

Is there any reason why 1.8.4’s YAML exposes what seems to  
be an implementation detail of how many bits it takes to  
overflow into a Bignum.

It seems for interoperability with other languages that  
use yaml, it’d be very nice to hide this detail and  
simply show the (possibly large) integer value, as  
it appears 1.8.2 did.

=============with 1.8.4=============  
=\> true  
irb(main):003:0\> puts [1,1\<\<200].to\_yaml

- 1
- !ruby/object:Bignum  
1606938044258990275541962092341162602522202993782792835301376  
=\> nil

## =============with 1.8.2============= irb(main):014:0\> puts [1, 1\<\<200].to\_yaml

- 1
- 1606938044258990275541962092341162602522202993782792835301376  
=\> nil

---

<div class="post-metadata">

**Author:** ![Ron\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@Ron\_M](https://www.ruby-forum.com/u/Ron_M)\
**Post date:** [February 21, 2006, 11:43pm UTC](https://www.ruby-forum.com/t/yamls-handling-of-bignums-in-1-8-4/71126/2 "2006-02-21T23:43:46Z")

</div>

On Feb 20, 2006, at 5:33 PM, Ron M wrote:

> Is there any reason why 1.8.4’s YAML exposes what seems to  
> be an implementation detail of how many bits it takes to  
> overflow into a Bignum.
> 
> It seems for interoperability with other languages that  
> use yaml, it’d be very nice to hide this detail and  
> simply show the (possibly large) integer value, as  
> it appears 1.8.2 did.

Seems to be platform-specific:

## $ uname -a Darwin [kaa.coop.robotcoop.com](http://kaa.coop.robotcoop.com) 8.5.0 Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST 2006; root:xnu-792.6.61.obj~1/RELEASE\_PPC Power Macintosh powerpc $ ruby -v -ryaml -e ‘puts [1, 1\<\<200].to\_yaml’ ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

- 1
- 1606938044258990275541962092341162602522202993782792835301376

## $ uname -a FreeBSD [sandbox.robotcoop.com](http://sandbox.robotcoop.com) 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Wed Feb 23 15:47:08 CST 2005 root@fbsdbootload:/usr/obj/usr/src/ sys/theplanet i386 $ ruby -v -ryaml -e ‘puts [1, 1\<\<200].to\_yaml’ ruby 1.8.4 (2005-12-24) [i386-freebsd4]

- 1
- !ruby/object:Bignum  
1606938044258990275541962092341162602522202993782792835301376

(same for FreeBSD 5.4 and 6.0)

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
