Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
71efd39f
Commit
71efd39f
authored
Jan 09, 2019
by
John van Groningen
Browse files
add macros for Infinity, NaN, isNaN, isInfinity and isFinite
parent
4c8e1531
Changes
3
Hide whitespace changes
Inline
Side-by-side
Libraries/StdEnv/StdEnv 64 Changed Files/StdReal.icl
View file @
71efd39f
...
...
@@ -325,3 +325,10 @@ entier a
=
code inline {
entierR
}
Infinity
:==
1E9999
NaN
:==
1E9999
+(
-1E9999
)
isNaN
x
:==
if
(
x
==
x
)
False
True
isInfinity
x
:==
if
(
abs
x
==
1E9999
)
True
False
isFinite
x
:==
if
(
x
-
x
==
0.0
)
True
False
Libraries/StdEnv/StdReal.dcl
View file @
71efd39f
...
...
@@ -57,3 +57,10 @@ instance atanh Real // Arc Hyperbolic Tangent, partial function, only defined i
// Additional conversion:
entier
::
!
Real
->
Int
// Convert Real into Int by taking entier
Infinity
:==
1E9999
NaN
:==
1E9999
+(
-1E9999
)
isNaN
x
:==
if
(
x
==
x
)
False
True
isInfinity
x
:==
if
(
abs
x
==
1E9999
)
True
False
isFinite
x
:==
if
(
x
-
x
==
0.0
)
True
False
Libraries/StdEnv/StdReal.icl
View file @
71efd39f
...
...
@@ -325,3 +325,10 @@ entier a
=
code inline {
entierR
}
Infinity
:==
1E9999
NaN
:==
1E9999
+(
-1E9999
)
isNaN
x
:==
if
(
x
==
x
)
False
True
isInfinity
x
:==
if
(
abs
x
==
1E9999
)
True
False
isFinite
x
:==
if
(
x
-
x
==
0.0
)
True
False
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment