Yep, I'm convinced, so I'll (at some point) make it either
print .3 in this case or print as an exponential number.

That might mean moving from implementing these
prints with C's %g to selecting between %f and %e
ourselves.

Thanks,

-michael

On 7/7/15, 6:22 PM, "Brad Chamberlain" <[email protected]> wrote:

>
>Nikhil's argument (that .0 is a sig fig and therefore misleading to print
>out) seems correct to me.
>
>-Brad
>
>
>On Tue, 7 Jul 2015, Nikhil Padmanabhan wrote:
>
>> Hi Michael,
>>
>> Well, I would have expected 314159.3. (I might not have complained if I
>>had gotten 314159.2, although a double should round that correctly)
>>
>> The issue is that 314159.0 has seven significant figures, and does not
>>agree with the variable at that level of precision. At six sig figs, I
>>think you would have had to write out “314159." (no trailing zero)…..
>>which I admit looks strange.
>>
>> My preference would be to round to seven sig figs instead of six.  Or
>>if you’re worried about real(32)’s running out of precision by then,
>>switch over to scientific notation one digit before….
>>
>> Hope that helps,
>> — Nikhil
>>
>>> On Jul 7, 2015, at 16:44, Michael Ferguson <[email protected]> wrote:
>>>
>>> Hi Nikhil -
>>>
>>> It may seem odd... but the implementation is currently behaving
>>> as I would have expected it to. It's rounding the number
>>> to 6 significant digits and then putting a .0 at the end
>>> to indicate it's a real (vs integer) value.
>>>
>>> Could you say more about what you expect it to output?
>>>
>>> Thanks,
>>>
>>> -michael
>>>
>>> On 7/2/15, 7:48 PM, "Nikhil Padmanabhan" <[email protected]>
>>> wrote:
>>>
>>>> Hi ‹
>>>>
>>>> I¹m getting unexpected behavior with writeln :
>>>>
>>>> Consider :
>>>>
>>>> var pi = 314159.2654;
>>>> writeln(pi);
>>>>
>>>> If I run this, I get
>>>>
>>>> 314159.0
>>>>
>>>> which is not what I would have expected.
>>>>
>>>> Thanks!
>>>> - Nikhil
>>>>
>>>>
>>>>
>>>> 
>>>>-----------------------------------------------------------------------
>>>>---
>>>> ----
>>>> Don't Limit Your Business. Reach for the Cloud.
>>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>>> you need to offload your IT needs and focus on growing your business.
>>>> Configured For All Businesses. Start Your Cloud Today.
>>>> 
>>>>https://urldefense.proofpoint.com/v2/url?u=https-3A__www.gigenetcloud.c
>>>>om_&d=AwIF-g&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=F-yGfBijtBNz4o82aXBgI8xeQNgBHrG
>>>>_jOC9Tihd3Ew&m=YaFCSIplkZywS4aH72tUEKiTgx21c4BcVjuyCwsNiI0&s=yy4b221P0Z
>>>>3fmY1Ddvvzw36Z6AJdVoZ6CIr21VvJTfg&e=
>>>> _______________________________________________
>>>> Chapel-bugs mailing list
>>>> [email protected]
>>>> 
>>>>https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.
>>>>net_lists_listinfo_chapel-2Dbugs&d=AwIF-g&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=F-
>>>>yGfBijtBNz4o82aXBgI8xeQNgBHrG_jOC9Tihd3Ew&m=YaFCSIplkZywS4aH72tUEKiTgx2
>>>>1c4BcVjuyCwsNiI0&s=mJvlXHGh9-LVtEW4efN91xvK4OMw1MgQYGU8yHKhPhY&e=
>>>
>>
>>
>> 
>>-------------------------------------------------------------------------
>>-----
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Chapel-bugs mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/chapel-bugs

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Chapel-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-bugs

Reply via email to