Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Test-integerness/REXX/test-integerness-2.rexx
Normal file
24
Task/Test-integerness/REXX/test-integerness-2.rexx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* REXX ---------------------------------------------------------------
|
||||
* Extra credit
|
||||
* Instead of using the datatype built-in function one could use this
|
||||
*--------------------------------------------------------------------*/
|
||||
Call testi 25.000000
|
||||
Call testi 24.999999
|
||||
Call testi 25.000100
|
||||
Call testi 0.9999999
|
||||
Call testi -0.9999999
|
||||
Exit
|
||||
|
||||
testi:
|
||||
Parse Arg x
|
||||
If pos('.',x)>0 Then Do
|
||||
xx=abs(x)
|
||||
Parse Value abs(xx) With '.' d
|
||||
d5=left(d,5,0)
|
||||
End
|
||||
Else d5=''
|
||||
If d5='' | wordpos(d5,'00000 99999')>0 Then
|
||||
Say x 'is an integer'
|
||||
Else
|
||||
Say x 'isn''t an integer'
|
||||
Return
|
||||
Loading…
Add table
Add a link
Reference in a new issue