Table 6-8. Math Functions
Basic Syntax | Crystal Syntax |
---|---|
Abs(number) | Abs(number) |
Ceiling(number, multiple) | Ceiling(number, multiple) |
Fix(number, decimals) | Truncate(number, decimals) |
Int(number), numerator \ denominator | Int(number), numerator \ denominator |
Pi | Pi |
Remainder(numerator, denominator), | Remainder(numerator, denominator), |
numerator Mod denominator | numerator Mod denominator |
Round(number, decimals),RoundUp(number, decimals) | Round(number, decimals),RoundUp(number, decimals) |
Sgn(number) | Sgn(number) |
Sqr(number), Exp(number), Log(number) | Sqr(number), Exp(number), Log(number) |
Cos(number), Sin(number), Tan(number), Atn(number) | Cos(number), Sin(number), Tan(number), Atn(number) |