← DL-Pascal collection

cov06.log

DOWNLOAD ORIGINAL FILE

=== Section 6: Math Functions ===
    (DL-Pascal 1.2 bugs exposed + workarounds)

-- Bug Demonstrations --
  [BUG_NEGREAL] negative real comparison
  BUG_NEGREAL >  : got False (BUG confirmed - -3 > -5 is True)
  BUG_NEGREAL <  : got True  (BUG confirmed - -3 < -5 is False)
OK   BUG_NEGREAL workaround a>b
OK   BUG_NEGREAL workaround a<b
OK   BUG_NEGREAL safe a>b
FAIL BUG_NEGREAL safe a<b

  [BUG_REALINIT] real variable init with integer
  BUG_REALINIT: a := 123 (integer) -> a = 123.000000
OK   BUG_REALINIT workaround
  BUG_REALINIT: b := 123.0 (real)    -> b = 123.000000

-- Basic Math --
OK   Abs int pos
OK   Abs int neg
OK   Abs int zero
OK   Abs real neg
OK   Abs real pos
OK   Sqr 0
OK   Sqr 5
OK   Sqr -4
OK   Sqr real
OK   Sqrt 0
OK   Sqrt 4
OK   Sqrt 9
OK   Sqrt 2
OK   Sqrt(Sqr)

-- Rounding --
OK   Trunc 3.9
OK   Trunc 3.1
OK   Trunc -3.9
OK   Trunc -3.1
OK   Round 3.4
OK   Round 3.5
OK   Round -3.4
OK   Round -3.5
OK   Frac 3.75
OK   Frac whole
  BUG_NEGREAL Frac: direct r<0 = TRUE
OK   Frac -3.75 workaround
OK   Int 3.75
OK   Int whole
  BUG_NEGREAL Int: direct r<0 = TRUE
OK   Int -3.75 workaround
OK   Ceil 3.1
OK   Ceil 4.0
OK   Ceil -3.1 workaround
OK   Floor 3.9
OK   Floor 4.0
OK   Floor -3.1 workaround
OK   RoundDig 3
OK   RoundDig 5

-- Log/Exp --
OK   Exp 0
OK   Exp 1=e
OK   Exp -1
OK   Ln 1
OK   Ln 2
OK   Exp(Ln)
OK   Log 1
OK   Log 10
OK   Log 100
OK   Log vs Ln

-- Power --
OK   Power 2^10
OK   Power 4^0.5
OK   Power 2^-1
OK   PowInt 2^10
OK   PowInt 3^0
OK   PowInt 2^-3
  BUG_NEGREAL PowInt: direct r<0 = TRUE
OK   PowInt -2^3 workaround
OK   PowInt -2^4

-- Trig radians --
OK   Sin 0
OK   Sin pi/2
OK   Sin pi=0
OK   Cos 0
OK   Cos pi/2=0
  BUG_NEGREAL Cos(pi): direct r<-0.9 = FALSE
OK   Cos pi workaround
OK   Tan 0
OK   Tan pi/4
OK   sin2+cos2=1

-- Trig degrees --
OK   Sin 90=1
OK   Sin 180=0
OK   Cos 0=1
OK   Cos 90=0
OK   Cos 60=0.5
OK   Tan 45=1
OK   sin2+cos2 deg

-- ArcTrig --
OK   ArcSin 0
OK   ArcSin 1
  BUG_NEGREAL ArcSin(-1): direct r<0 = TRUE
FAIL ArcSin -1 workaround
OK   ArcCos 1=0
OK   ArcCos 0
OK   ArcCos -1=pi
OK   ArcTan 0
OK   ArcTan 1
  BUG_NEGREAL ArcTan(-1): direct r<0 = TRUE
FAIL ArcTan -1 workaround
OK   Sin(ArcSin)
OK   Cos(ArcCos)
OK   Tan(ArcTan)

-- Hyperbolic --
  BUG_ARCSINH0: ArcSinH(0) skipped (crashes)
OK   SinH 1
OK   ArcSinH 1
OK   ArcSinH(SinH)
OK   CosH 0=1
OK   CosH 1
OK   ArcCosH 1=0
OK   ArcCosH(CosH)
  BUG_ARCTANH0: ArcTanH(0) skipped (crashes)
OK   TanH 1
OK   ArcTanH 0.5
OK   ArcTanH(TanH)
OK   cosh2-sinh2=1

-- Identities --
OK   Euler cos
OK   Euler sin
OK   Log product
OK   Ln power
OK   Sin double
OK   Sqrt=Power

=== Section 6 complete ===