langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,4 @@
def posinf = double.PositiveInfinity;
def a = IsInfinity(posinf); // a = true
def b = IsNegativeInfinity(posinf); // b = false
def c = IsPositiveInfinity(posinf); // c = true

View file

@ -0,0 +1 @@
infinity

View file

@ -0,0 +1,5 @@
MESSAGE
1.0 / 0.0 SKIP
-1.0 / 0.0 SKIP(1)
( 1.0 / 0.0 ) = ( -1.0 / 0.0 )
VIEW-AS ALERT-BOX.

View file

@ -0,0 +1,20 @@
print 1.5e-400 '0
print 1.5e400 '#INF
print -1.5e400 '#-INF
print 0/-1.5 '-0
print 1.5/0 '#INF
print -1.5/0 '#-INF
print 0/0 '#qNAN
function f() as double
return -1.5/0
end function
print f '#-INF

View file

@ -0,0 +1,13 @@
declare
PosInf = 1./0.
NegInf = ~1./0.
in
{Show PosInf}
{Show NegInf}
%% some assertion
42. / PosInf = 0.
42. / NegInf = 0.
PosInf * PosInf = PosInf
PosInf * NegInf = NegInf
NegInf * NegInf = PosInf

View file

@ -0,0 +1,3 @@
infty()={
[1] \\ Used for many functions like intnum
};

View file

@ -0,0 +1,3 @@
declare x float, y float (15), z float (18);
put skip list (huge(x), huge(y), huge(z));

View file

@ -0,0 +1 @@
/infinity { 9 99 exp } def

View file

@ -0,0 +1,3 @@
function infinity {
[double]::PositiveInfinity
}

View file

@ -0,0 +1,19 @@
If OpenConsole()
Define.d a, b
b = 0
;positive infinity
PrintN(StrD(Infinity())) ;returns the value for positive infinity from builtin function
a = 1.0
PrintN(StrD(a / b)) ;calculation results in the value of positive infinity
;negative infinity
PrintN(StrD(-Infinity())) ;returns the value for negative infinity from builtin function
a = -1.0
PrintN(StrD(a / b)) ;calculation results in the value of negative infinity
Print(#crlf$ + #crlf$ + "Press ENTER to exit"): Input()
CloseConsole()
EndIf

View file

@ -0,0 +1,8 @@
>> x = inf()
inf
>> isinf(x)
1
>> inf() > 10
1
>> -inf() > 10
0

View file

@ -0,0 +1 @@
const float: Infinity is 1.0 / 0.0;

View file

@ -0,0 +1 @@
PositiveInfinity

View file

@ -0,0 +1 @@
Real.posInf

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,4 @@
function infinity()
{
return 1/0;
}

View file

@ -0,0 +1,3 @@
: inf 1.0 0.0 / ;
: -inf inf neg ;
: inf? abs inf = ;

View file

@ -0,0 +1,3 @@
#import flo
infinity = inf!

View file

@ -0,0 +1,7 @@
Dim PlusInfinity as Double
Dim MinusInfinity as Double
Dim IndefiniteNumber as Double
On Error Resume Next
PlusInfinity = 1 / 0
MinusInfinity = -1 / 0
IndefiniteNumber = 0 / 0