珀尔 | sin()函数
此函数用于计算 VALUE 的正弦值,如果 VALUE 被省略,则为 $_。这个函数总是返回一个浮点数。
Syntax: sin(VALUE)
Parameters:
VALUE in the form of float
Returns: Function returns sine of VALUE.
示例 1:
#!/usr/bin/perl
# Calling sin() function
$var = sin(5);
# Printing value for sin(5)
print "sin value of 5 is $var";
输出:
sin value of 5 is -0.958924274663138
示例 2:
#!/usr/bin/perl
# Calling sin() function
$var = sin(9);
# Printing value for sin(9)
print "sin value of 9 is $var";
输出:
sin value of 9 is 0.412118485241757