1. printf()

Hi,

I just detected that

   printf(1, "%d\n", {1e254})

prints 255 '*'s. I wonder, whether this is intended.

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  This message has been ROT-13 encrypted
  X   e-mail and news,      |  twice for higher security.
 / \  and unneeded MIME     |

new topic     » topic index » view message » categorize

2. Re: printf()

On Saturday 10 May 2003 10:39 am, you wrote:
>
> Hi,
>
> I just detected that
>
>    printf(1, "%d\n", {1e254})
>
> prints 255 '*'s. I wonder, whether this is intended.
>
> Best regards,
>    Juergen

On Linux, it prints:
9999999999999999363587069377675917736425707327570073564839440723358156278=
0527075488933869
9458694757798103518260940569245515066416531433574377226240942000556018171=
9702721238568128
8624374039982763538319739206631507774359582937997162411679696940490282762=
240
Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: printf()

Irv wrote:

> On Saturday 10 May 2003 10:39 am, you wrote:
>>
>> Hi,
>>
>> I just detected that
>>
>>    printf(1, "%d\n", {1e254})
>>
>> prints 255 '*'s. I wonder, whether this is intended.
>>
>> Best regards,
>>    Juergen
>
> On Linux, it prints:
>
> 99999999999999993635870693776759177364257073275700735648394407233581562780527075488933869
>
> 94586947577981035182609405692455150664165314335743772262409420005560181719702721238568128
> 8624374039982763538319739206631507774359582937997162411679696940490282762240
> Irv

Sorry, I forgot to mention, that I got that result on Windows 98, using
the Eu 2.4 Beta interpreter.

Best regards,
   Juergen

-- 
    |\      _,,,---,,_
    /,`.-'`'    -.  ;-;;,_
   |,4-  ) )-,_..;\ (  `'-'
  '---''(_/--'  `-'\_)

new topic     » goto parent     » topic index » view message » categorize

4. Re: printf()

I got the 255 '*'s.  v2.4 WinXP

Juergen Luethje wrote:

>
>Irv wrote:
>
>  
>>On Saturday 10 May 2003 10:39 am, you wrote:
>>    
>>
>>>Hi,
>>>
>>>I just detected that
>>>
>>>   printf(1, "%d\n", {1e254})
>>>
>>>prints 255 '*'s. I wonder, whether this is intended.
>>>
>>>Best regards,
>>>   Juergen
>>>      
>>>
>>On Linux, it prints:
>>>>99999999999999993635870693776759177364257073275700735648394407233581562780527075488933869
>>>>94586947577981035182609405692455150664165314335743772262409420005560181719702721238568128
>>8624374039982763538319739206631507774359582937997162411679696940490282762240
>>Irv
>>    
>>
>Sorry, I forgot to mention, that I got that result on Windows 98, using
>the Eu 2.4 Beta interpreter.
>
>Best regards,
>   Juergen
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: printf()

Juergen Luethje wrote:
> I just detected that
> 
>    printf(1, "%d\n", {1e254})
> 
> prints 255 '*'s. I wonder, whether this is intended.

Irv Mullins writes:
 >On Linux, it prints:
>>99999999999999993635870693776759177364257073275700735648394407233581562780527075488933869
>>94586947577981035182609405692455150664165314335743772262409420005560181719702721238568128
 >8624374039982763538319739206631507774359582937997162411679696940490282762240

No, it wasn't intended. I'll make a note of it. Thanks.
Euphoria's printf() does a bit of pre-processing before
calling C's printf(). The asterisks were generated by
Watcom C, used to build the DOS and WIN interpreters.
On Linux, GCC gives a better result
(accurate to about 16 decimal places.)

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu