Real constants and functions: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 1,309:
math.ceil(x)
x^y</lang>
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module Checkit {
Def exp(x)= 2.71828182845905^x
Print Ln(exp(1))==1
Print Log(10^5)==5
Print Sgn(-5)=-1
Print Abs(-2.10#)=2.1#
Def exptype$(x)=type$(x)
Print exptype$(Abs(-2.1#))="Currency"
Print exptype$(Abs(-2.1~))="Single"
Print exptype$(Abs(-2.1@))="Decimal"
Print exptype$(Abs(-2&))="Long"
Print exptype$(Abs(-2%))="Integer"
Print exptype$(Abs(-2.212e34))="Double"
Print exptype$(Sgn(-2.1#))="Integer"
\\ Sgn return integer type
Print exptype$(Sgn(-2.212e34))="Integer"
\\ Log, Len return double
Print exptype$(Log(1000))="Double"
Print exptype$(exp(1%))="Double"
Print exptype$(Ln(1212%))="Double"
\\ power return type Double
Print exptype$(2&^2&)="Double"
Print exptype$(2&**2&)="Double"
Print exptype$(2&*2&)="Long"
Print 2**2=4, 2^2=4, 2^2^2=16, 2**2**2=16
\\ floor() and Int() is the same
Print Int(-2.7)=-3, Int(2.7)=2
Print Floor(-2.7)=-3, Floor(2.7)=2
Print Ceil(-2.7)=-2, Ceil(2.7)=3
Print Sqrt(4)=2
}
Checkit
</lang>
=={{header|Maple}}==
|