Mercurial > hg > octave-nkf
comparison src/sysdep.cc @ 1415:f18474c64e72
[project @ 1995-09-15 10:09:57 by jwe]
author | jwe |
---|---|
date | Fri, 15 Sep 1995 10:13:17 +0000 |
parents | 083787534e18 |
children | 045e70a15a8f |
comparison
equal
deleted
inserted
replaced
1414:88ba3aed5697 | 1415:f18474c64e72 |
---|---|
86 // Octave's idea of not a number. | 86 // Octave's idea of not a number. |
87 double octave_NaN; | 87 double octave_NaN; |
88 | 88 |
89 // The floating point format on this system. | 89 // The floating point format on this system. |
90 floating_point_format native_float_format = OCTAVE_UNKNOWN_FLT_FMT; | 90 floating_point_format native_float_format = OCTAVE_UNKNOWN_FLT_FMT; |
91 | |
92 // Nonzero if the machine we are running on is big-endian. | |
93 int octave_words_big_endian; | |
91 | 94 |
92 #if defined (HAVE_FLOATINGPOINT_H) | 95 #if defined (HAVE_FLOATINGPOINT_H) |
93 #include <floatingpoint.h> | 96 #include <floatingpoint.h> |
94 #endif | 97 #endif |
95 | 98 |
247 | 250 |
248 if (native_float_format == OCTAVE_UNKNOWN_FLT_FMT) | 251 if (native_float_format == OCTAVE_UNKNOWN_FLT_FMT) |
249 panic ("unrecognized floating point format!"); | 252 panic ("unrecognized floating point format!"); |
250 } | 253 } |
251 | 254 |
255 static void | |
256 ten_little_endians (void) | |
257 { | |
258 // Are we little or big endian? From Harbison & Steele. | |
259 | |
260 union | |
261 { | |
262 long l; | |
263 char c[sizeof (long)]; | |
264 } u; | |
265 | |
266 u.l = 1; | |
267 | |
268 octave_words_big_endian = (u.c[sizeof (long) - 1] == 1); | |
269 } | |
270 | |
252 #if defined (EXCEPTION_IN_MATH) | 271 #if defined (EXCEPTION_IN_MATH) |
253 extern "C" | 272 extern "C" |
254 { | 273 { |
255 int | 274 int |
256 matherr (struct exception *x) | 275 matherr (struct exception *x) |
290 #ifdef NeXT | 309 #ifdef NeXT |
291 NeXT_init (); | 310 NeXT_init (); |
292 #endif | 311 #endif |
293 | 312 |
294 octave_ieee_init (); | 313 octave_ieee_init (); |
314 | |
315 ten_little_endians (); | |
295 } | 316 } |
296 | 317 |
297 // Set terminal in raw mode. From less-177. | 318 // Set terminal in raw mode. From less-177. |
298 // | 319 // |
299 // Change terminal to "raw mode", or restore to "normal" mode. | 320 // Change terminal to "raw mode", or restore to "normal" mode. |