作者charleshu (Analog Engineer)
看板Perl
标题Re: [请益] 关於三角反函数
时间Mon Aug 2 14:01:11 2010
※ 引述《megadeth893 (加保)》之铭言:
: 最近碰到写有关三角反函数的部份
: 不过发现好像只有sin cos可以用
: 其他好像都没有函数可用
: 更别说反函数
: 不过在这里
: 我想问的是有关cos-1的反余弦函数
: 在perl程式理该如何表示
: 感谢
可以使用 POSIX
use POSIX;
这样就可以使用 POSIX 底层支援的函数.
跟其它 Module 不太一样的是code并不是由 perl 的Module所提供, 而是底层
POSIX 函数的 export, 好处是它的行为应该会跟同平台下的C语言里的函数相
同,包含若有 bug 也会一样, 也可能会稍微节省一些记忆体, 但缺点是并不保
证与其他平台下的 perl 完全一样.
它有支援 acos asin atan 等函数.
完整说明如下.
The POSIX module permits you to access all (or nearly all) the standard POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish interfaces.
Everything is exported by default with the exception of any POSIX functions with the same name as a built-in Perl function, such as abs, alarm, rmdir, write, etc.., which will be exported only if you ask for them explicitly. This is an unfortunate backwards compatibility feature. You can stop the exporting by saying use POSIX () and then use the fully qualified names (ie. POSIX::SEEK_END).
This document gives a condensed list of the features available in the POSIX module. Consult your operating system's manpages for general information on most features. Consult the perlfunc manpage for functions which are noted as being identical to Perl's builtin functions.
The first section describes POSIX functions from the 1003.1 specification. The second section describes some classes for signal objects, TTY objects, and other miscellaneous objects. The remaining sections list various constants and macros in an organization which roughly follows IEEE Std 1003.1b-1993.
--
Do not depend on others without effort...
当我年轻时,请教别人问题时常听到上面那句话. 当时心里偶而会有些小小抱怨.
当时间过去,我偶而会想到上面那句话, 心中十分感谢当初告诉我那句话的人.
当发现问题时,最有价值的不是问题的答案,
而是找到解决的方向,并在努力的过程里具备解决问题的能力.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 211.74.92.237