Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols nobinary
|
||||
|
||||
numeric digits 20
|
||||
|
||||
loop n_ over getTestData()
|
||||
-- could have used n_.datatype('N') directly here...
|
||||
if isNumeric(n_) then msg = 'numeric'
|
||||
else msg = 'not numeric'
|
||||
say ('"'n_'"').right(25)':' msg
|
||||
end n_
|
||||
|
||||
return
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
-- Pointless in NetRexx; the DATATYPE built-in-function is more powerful!
|
||||
method isNumeric(testString) public static returns boolean
|
||||
return testString.datatype('N')
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method getTestData() private static returns Rexx[]
|
||||
|
||||
-- Coercing numbers into the Rexx type has the effect of converting them to strings.
|
||||
-- NetRexx will still perform arithmetic on Rexx strings if those strings represent numbers.
|
||||
-- Notice that whitespace between the sign and the number are ignored even when inside a string constant
|
||||
testData = [ Rexx -
|
||||
' one and a half', 1, 1.5, 1.5e+27, ' 1 ', ' 1.5 ', ' 1.5e+27 ', -
|
||||
'-one and a half', - 1, - 1.5, - 1.5e-27, ' - 1 ', '- 1.5 ', '- 1.5e-27 ', -
|
||||
'+one and a half', + 1, + 1.5, + 1.5e+27, ' + 1 ', '+ 1.5 ', '+ 1.5e+27 ', -
|
||||
'Math Constants', -
|
||||
Math.PI, Math.E, -
|
||||
-Math.PI, -Math.E, -
|
||||
+Math.PI, +Math.E, -
|
||||
'Numeric Constants', -
|
||||
Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY -
|
||||
]
|
||||
return testData
|
||||
Loading…
Add table
Add a link
Reference in a new issue