[cctbxbb] pyyaml - iotbx.pdb incompatibility
James Stroud
xtald00d at gmail.com
Mon Apr 15 23:21:47 PDT 2013
On Apr 15, 2013, at 11:21 PM, Nathaniel Echols wrote:
> Is your example more or less what YAML does that triggers the crash?
Yes, the example I gave is essentially the YAML code distilled. For some reason yaml wants to make infs and nans. Here is around 256 of yaml/constructor.py:
inf_value = 1e300
while inf_value != inf_value*inf_value: # ⇐ Line 256
inf_value *= inf_value
nan_value = -inf_value/inf_value # Trying to make a quiet NaN (like C99).
But what they are doing really doesn't make any sense to do, because infs and nans can be made in python without all of the gymnastics:
>>> inf_value == float('inf')
>>> nan_value = flaot('nan')
I would agree that boost's trapping the conditional on line 256 is not a bug. If 1e300 * 1e300 were defined, they wouldn't "need" to use a loop to find the nan.
James
More information about the cctbxbb
mailing list