On 12 September 2014 18:47, Henrik Lindberg <[email protected]>
wrote:

> On 2014-12-09 3:21, Ken Barber wrote:
>
>> Instead of continuing on the old thread "A question about numbers and
>>> representation", I decided to open a new thread avout BigDecimal to see
>>> if
>>> we can come to closure on that separately.
>>>
>>> Digging a bit more into Ruby, and how it handles floating point reveals
>>> that
>>> there is in fact no automatic fluent transition to BigDecimal. All
>>> floating
>>> point calculations are performed with the native double representation on
>>> the platform ruby is executing on. Since Puppet does not create any
>>> BigDecimal numbers no one has ever been able to create a value with
>>> higher
>>> precision in Puppet than what the native double provides (unless doing
>>> so in
>>> custom Ruby functions I should add).
>>>
>>
>> So wow, this never worked? I can't say I'm surprised. I wonder if
>> there are any real world cases where people have done this in ruby
>> plugins.
>>
>> ken.
>>
>>  BigDecimal is only mentioned once in the puppet code base in the
> vendored RGen gem (it supports BigDecimal attributes (unused by Puppet
> though)).
>
> In Facter the CFPropertyList util checks if BigDecimal is defined and uses
> it to parse a number and return a CFReal (I did not dig further how CFReal
> is used). I guess this means that a CFReal could surface from Facter
> somhow, but not sure what it does internally.
>
>
If it does surface one Puppet would turn it into a string, unless CFReal is
subclass of Number.

-- 
Erik Dalén

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CAAAzDLejU0cSV%2BD1OVVH4FgyR8VD5-UDhN%3Dxn4e%2B%3DUpapuGuRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to