Module arith

Builtin predicates for arithmetic operations

Contents

Predicate


Top of this page Contents Index of this package LiLFeS Documents LiLFeS Home Page Tsujii laboratory

Predicate

floattoint/2

Formatfloattoint(+IN,+OUT)
Arguments
+INfloatfloat
Convert float IN to integer OUT.

floor/2

Formatfloor(+$NUM1,-$NUM2)
Arguments
+$NUM1integer or float number
-$NUM2bot number for result
Get the maximum integer under $NUM1 to $NUM2.

log/2

Formatlog(+NUM,-LOG)
Arguments
+NUMfloat float
-LOGfloat logarithm
Return logarithm of number NUM.

exp/2

Formatexp(+NUM,-LOG)
Arguments
+NUMfloat float
-LOGfloat exponent
Return exponent of number NUM.

'/\'/3

Format'/\'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer number
+$NUM2integer number
-$ANSbot number for result
Get the $NUM1 AND $NUM2 to $ANS.

'\/'/3

Format'\/'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer number
+$NUM2integer number
-$ANSbot number for result
Get the $NUM1 OR $NUM2 to $ANS.

'#'/3

Format'#'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer number
+$NUM2integer number
-$ANSbot number for result
Get the $NUM1 XOR $NUM2 to $ANS.

'\'/2

Format'\'(+$NUM,-$ANS)
Arguments
+$NUMinteger number
-$ANSbot number for result
Get the NOT $NUM to $ANS.

'+'/3

Format'+'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer or float or std:string : number or std::string
+$NUM2integer or float or std:string : number or std::string
-$ANSinteger or float or std:string : number or std::string for result
Get the result of "$NUM1 + $NUM2" to $ANS.This can be apply to strings.
> ?- '+'(3,5.5,8.5).
 yes
 > ?- '+'(-10,5,X).
 X: -5
 > ?- '+'("abc","def",X).
 X: "abcdef" 

'-'/3

Format'-'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer or float number
+$NUM2integer or float number
-$ANSinteger or float number for result
Get result of "$NUM1 - $NUM2" to $ANS.
> ?- '-'(3,5.5,X).
 X: -2.50000

'*'/3

Format'*'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer or float number
+$NUM2integer or float number
-$ANSinteger or float number for result
Get result of "$NUM1 * $NUM2" to $ANS.
> ?- '*'(2,-6,X).
 X: -12

'/'/3

Format'/'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer or float number
+$NUM2integer or float number
-$ANSinteger or float number for result
Get result of "$NUM1 / $NUM2" to $ANS.
> ?- '/'(2,-6,X).
 X: -0.333333

'//'/3

Format'//'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer number
+$NUM2integer number
-$ANSinteger number for result
Get integer result of "$NUM1 / $NUM2" to $ANS.
> ?- '//'(36,5,X).
 X: 5

'///'/3

Format'///'(+$NUM1,+$NUM2,-$ANS)
Arguments
+$NUM1integer number
+$NUM2integer number
-$ANSinteger number for result
Get reminder of integer division "$NUM1 / $NUM2" to $ANS.
> ?- mod(36,5,X).
 X: 1

'>'/2

Format'>'(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is larger than $NUM2.
> ?- '>'(5.6,6).
 no
 > ?- '>'("abc","abC").
 yes

'>='/2

Format'>='(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is larger than $NUM2 or equal to $NUM2.
> ?- '>='(5.6,6).
 no
 > ?- '>='("abc","abC").
 yes

'<'/2

Format'<'(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is smaller than $NUM2.
> ?- '<'(5.6,6).
 yes
 > ?- '<'("abc","abC").
 no

'<='/2

Format'<='(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is smaller than $NUM2 or equal to $NUM2.
> ?- '<='(5.6,6).
 yes
 > ?- '>'("abc","abC").
 no

'=:='/2

Format'=:='(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is equal to $NUM2.

'=\='/2

Format'=\='(+$NUM1,+$NUM2)
Arguments
+$NUM1integer or float or std:string : input1
+$NUM2integer or float or std:string : input2
Success if $NUM1 is not equal to $NUM2.

Top of this page Contents Index of this package LiLFeS Documents LiLFeS Home Page Tsujii laboratory

This document is automatically created by lildoc on Fri Sep 24 14:13:57 2004