1. printf()
- Posted by Juergen Luethje <j.lue at gmx.de> May 10, 2003
- 355 views
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 |
2. Re: printf()
- Posted by irvm at ellijay.com May 10, 2003
- 355 views
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
3. Re: printf()
- Posted by Juergen Luethje <j.lue at gmx.de> May 10, 2003
- 357 views
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- ) )-,_..;\ ( `'-' '---''(_/--' `-'\_)
4. Re: printf()
- Posted by 1evan at sbcglobal.net May 10, 2003
- 346 views
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 > >
5. Re: printf()
- Posted by Robert Craig <rds at RapidEuphoria.com> May 11, 2003
- 356 views
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