📄 islogical.java
字号:
package jmathlib.toolbox.general;
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.core.tokens.LogicalToken;
import jmathlib.core.functions.ExternalFunction;
/**An external function which checks if the argument is a char*/
public class islogical extends ExternalFunction
{
public OperandToken evaluate(Token[] operands)
{
if (getNArgIn(operands) != 1)
throwMathLibException("islogical: number of arguments != 1");
if (operands[0] instanceof LogicalToken)
return DoubleNumberToken.one;
else
return DoubleNumberToken.zero;
}
}
/*
@GROUP
general
@SYNTAX
answer = islogical(value)
@DOC
Returns 1 if the first operand is a logical array, else it returns 0.
@EXAMPLES
<programlisting>
a=logical([1,2,0])
islogical(a) -> 1
</programlisting>
@NOTES
.
@SEE
ismatrix, isnumeric, isscalar, issquare
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -