Skip to content

Commit

Permalink
Add function to test if type is an integer type
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Harries committed Feb 6, 2017
1 parent f437342 commit 6167ed7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meta/CConversion.m
Expand Up @@ -13,6 +13,7 @@

ToRealType::usage="converts a given type to a type with real elements";

IsIntegerType::usage="Returns true if given type has integer elements";
IsRealType::usage="Returns true if given type has real elements";

GreekQ::usage = "Returns true if the given symbol contains one or more
Expand Down Expand Up @@ -183,6 +184,9 @@
ToRealType[CConversion`MatrixType[_,m_,n_]] := CConversion`MatrixType[realScalarCType, m, n];
ToRealType[CConversion`TensorType[_,n__]] := CConversion`TensorType[realScalarCType, n];

IsIntegerType[_[CConversion`integerScalarCType, ___]] := True;
IsIntegerType[_] := False;

IsRealType[_[CConversion`realScalarCType, ___]] := True;
IsRealType[_[CConversion`integerScalarCType, ___]] := True;
IsRealType[_] := False;
Expand Down

0 comments on commit 6167ed7

Please sign in to comment.