Talk:Literals/Floating point: Difference between revisions

From Rosetta Code
Content added Content deleted
m (add something=3 & ooRexx)
m (→‎REXX: added comment about the firth argument (being zero) for the FORMAT bif. -- ~~~~)
Line 9: Line 9:
format(something,,,,0) yields '3' (on ooRexx)
format(something,,,,0) yields '3' (on ooRexx)
--[[User:Walterpachl|Walterpachl]] 18:27, 27 August 2012 (UTC)
--[[User:Walterpachl|Walterpachl]] 18:27, 27 August 2012 (UTC)

Yes, I adjusted the explanation for the "rule" for the '''FORMAT''' bif for the fifth argument being zero.
<br>Note that if
<lang rexx>something = 3.0
say format(something,,,,0)</lang>should return
<pre>
3.0
</pre>
not
<pre>
3
</pre>
-- [[User:Gerard Schildberger|Gerard Schildberger]] 19:27, 27 August 2012 (UTC)

Revision as of 19:27, 27 August 2012

Fortran

I'm amazed that there is not a Fortran example for this yet. Since the ISO 1990 (1991?) standard (commonly called Fortran 90), Fortran has had some of the richest language-based (not library-dependent) floating point support around. ISO 2003 adds specific optional support for IEEE numbers too IIRC. I'll try to put together an example if I can find the time, but I no longer have access to a current Fortran compiler. --Balrog 09:19, 5 March 2011 (UTC)

REXX

not quite?

something=3; format(something,,,,0) yields '3' (on ooRexx) --Walterpachl 18:27, 27 August 2012 (UTC)

Yes, I adjusted the explanation for the "rule" for the FORMAT bif for the fifth argument being zero.
Note that if <lang rexx>something = 3.0 say format(something,,,,0)</lang>should return

3.0

not

3

-- Gerard Schildberger 19:27, 27 August 2012 (UTC)