2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,5 +1,9 @@
|
|||
Write a function which tests if infinity is supported for floating point numbers (this step should be omitted for languages where the language specification already demands the existence of infinity, e.g. by demanding [[IEEE]] numbers), and if so, returns positive infinity. Otherwise, return the largest possible positive floating point number.
|
||||
;Task:
|
||||
Write a function which tests if infinity is supported for floating point numbers (this step should be omitted for languages where the language specification already demands the existence of infinity, e.g. by demanding [[IEEE]] numbers), and if so, returns positive infinity. Otherwise, return the largest possible positive floating point number.
|
||||
|
||||
For languages with several floating point types, use the type of the literal constant 1.5 as floating point type.
|
||||
For languages with several floating point types, use the type of the literal constant '''1.5''' as floating point type.
|
||||
|
||||
C.F. [[Extreme floating point values]]
|
||||
|
||||
;Related task:
|
||||
* [[Extreme floating point values]]
|
||||
<br><br>
|
||||
|
|
|
|||
8
Task/Infinity/Kotlin/infinity.kotlin
Normal file
8
Task/Infinity/Kotlin/infinity.kotlin
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
val p = Double.POSITIVE_INFINITY // +∞
|
||||
println(p.isInfinite()) // true
|
||||
println(p.isFinite()) // false
|
||||
println("${p < 0} ${p > 0}") // false true
|
||||
val n = Double.NEGATIVE_INFINITY // -∞
|
||||
println(n.isInfinite()) // true
|
||||
println(n.isFinite()) // false
|
||||
println("${n < 0} ${n > 0}") // true false
|
||||
1
Task/Infinity/PARI-GP/infinity-1.pari
Normal file
1
Task/Infinity/PARI-GP/infinity-1.pari
Normal file
|
|
@ -0,0 +1 @@
|
|||
+oo
|
||||
Loading…
Add table
Add a link
Reference in a new issue