SRL Archive - SRL Bugs

Cose(90)


Gearsnare

2009-04-26 15:45:09

This code:

Writeln(FloatToStr(Cose(Round(Degrees(Pi / 2)))));
Outputs the line: -2.71050543121376E-20.
The actually value of Cos(90) = 0.

The rest of the values seem to work somehow though :confused:

ShowerThoughts

2009-04-26 15:49:57

Writeln(FloatToStr(Cose(Round(Degrees(Pi / 2)))));
Are you sure that
Round(Degrees(Pi / 2)))

returns 90?

Gearsnare

2009-04-26 16:49:11

Yes,

Writeln(IntToStr(Round(Degrees(Pi / 2))));
That writes 90 into the debug box.

Nava2

2009-04-26 17:20:43

Isn't the actual function Cos?

function Cos(e : Extended): Extended;
The Cos function is a mathematical function giving the Cosine value of X given in radians.

Gearsnare

2009-04-26 17:27:29

Cos is used when you have the angle in raidans, Cose when you have it in degrees.

Writeln(FloatToStr(Cos(Pi / 2)));

Returns same value, it's really strange =S

Nava2

2009-04-26 20:31:18

Scar bug… Talk to Freddy :)

marpis

2009-04-29 21:49:32

Line 3: [Error] (3:20): Unknown identifier 'Cose' in script 

Using scar 3.15b

but writeln(FloatToStr(Cos(Pi / 2))); returns
-2,71050543121376E-20 too, which is really weird