The fortran/basic sgn function returns -1, 0, 1 if x < 0, x == 0, x > 0 respectively.
| 53 | // The fortran/basic sgn function returns -1, 0, 1 if x < 0, x == 0, x > 0 |
| 54 | // respectively. |
| 55 | static int sign(int x) { |
| 56 | if (x < 0) |
| 57 | return -1; |
| 58 | else |
| 59 | return x > 0 ? 1 : 0; |
| 60 | } |
| 61 | |
| 62 | // Writes to the given file. Returns false in case of error. |
| 63 | bool ICOORD::Serialize(FILE* fp) const { |